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
Tag: three.js
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.
THREE.js raycasting very slow against single > 500k poly (faces) object, line intersection with globe
in my project I have a player walk around a globe. The globe is not just a sphere, it has mountains and valleys, so I need the players z position to change. For this I’m raycasting a single ray from player’s position against a single object (the globe) and I get the point they intersect and change players position accordingly.
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
Three.js – Why is the shadow of these items looking like this?
I’m learning about three.js. I make a example to practise but the shadow of the items is looking wrong or stranger. Should be like this (this image is of a old tutorial): And the code is this: And please, if you know about a good beginner three.js tutorial or course (I don’t care if it isn’t free), tell me, because
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