Skip to content

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,…

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 bette…

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 t…

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 lo…

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

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 noth…