Skip to content
Advertisement

Tag: three.js

THREE.js Cannot Import Module

I am trying to import the threejs and GLTFLoader modules, both of which ( for testing ) are in the same root/js/ folder.. I get the mimetype issue but the error isn’t thrown when in the three master ‘structure’, so why doesn’t this work? EDIT: So when uncommenting the import GLTF line, the error thrown is the following: It seems

bufferGeometry setFromPoints with react-three-fiber

Considering toLinePath function: I want to recreate it using react-three-fiber and been trying something like this: But there’s no output/error at all. I suppose I’ve completely misunderstood react-three-fibers API. What am I doing wrong here? Thanks and here’s the sandbox Answer For a future googler, useUpdate has been removed here: https://github.com/pmndrs/react-three-fiber/pull/996. Use useLayoutEffect instead.

ThreeJS Hemisphere

This is quite possibly a very simple question, so apologies in advance. I’m trying to make a 3D hemisphere in ThreeJS. I can create a hemisphere (in case I’m using the wrong word, a sphere, cut in half!) outer using the Circle or CircleBuffer geometry, but this leaves the flat side ‘empty’ for lack of a better word. I have

webVR resetPose replacement

I have a webVR project that used resetPose to reset the origin of the scene but apparently is now deprecated. I used it to reset the camera, so the user would look at the center of the scene again. I assume this function isn’t too hard to replicate: you either have to rotate the scene or the camera to the

Post Effects and Transparent background in three.js

Trying to use the transparent background with some post effect like the Unreal Bloom, SMAA and Tonemapping provided in the examples but it seems to break the transparency from my render. If I deactivate the bloom pass I get a correct transparent background but when activated, I obtain a black background. I looked at the sources and it seems that

How to load shader from external file? THREE.FileLoader

I want to load shader from external file. This shader is correct, as it works when inserted in <script> tag. I do the following: Later I use it as: The problem is that when i reload the page I mave errors, that shaders are not defined. When I type vShader in console it prints me out what I want. When

Best Fit Rectangle From Set of Coplanar Points in Three.js

First off, I apologize if there is a solution for this somewhere, but I’ve done a great deal of digging through Three.js and A-Frame docs as well as Stack Overflow and haven’t found what I’m looking for. What I want to do is create a best-fit A-Frame plane from a set of Vector3s that I already know are coplanar. This

How to zoom a three.js scene with the mouse wheel?

I have a simple three.js graphics, and I tried to use the answers in this and this question to make the created plot zoomable by the mouse wheel. By using the mouse wheel I would like to zoom in to the graphics or to zoom out. Here is the complete code: pastebin link However, when turning the mouse wheel nothing

Advertisement