Skip to content

Tag: three.js

three.js Cube Geometry – how to update parameters?

Possibly dumb question but here goes. Three.js geometries have ‘parameter’ feilds associated with them, see the box geometry here… box Geometry parameters I am trying to update these parameters like this… But of course, the geometry remains unchanged. Is there a way of updating the geo…

How to add folders in dat.gui?

I’m trying to add folders for a the lights in a three.js project that i copied from a three.js example. But i can’t get it working. I guess i should use f1=add.folder(‘light1’) and then somehow add the parameters to f1 with f1.add(‘intensity’) etc… but how to do this,…

Load textures from Base64 in Three.js

I am currently loading textures from URLs but since my back-end code is generating planets I need them to be displayed using Base64. (I’m playing around with procedural generation so I’d prefer not to save the image and then load it via URL) Here’s the code; I have tried; But it doesn’…

How to effectively use TraingleStripDrawMode in three.js?

THREE.js have included TriangleStripDrawMode, or TriangleFanDrawMode for some revisions now. I have tried searching for it online, as well as experimenting on my own to understand it better, but all is wasted. I still don’t know how to utilize these modes to prevent redundancy, or to minimize the data e…

Detect sound is ended in THREE.PositionalAudio?

I want to detect when sounds is ending, but all examples that i found not working. Live example: http://codepen.io/anon/pen/wMRoWQ Answer Three.Audio is wrapper around a buffer source audio object. https://github.com/mrdoob/three.js/blob/ddab1fda4fd1e21babf65aa454fc0fe15bfabc33/src/audio/Audio.js#L12 It looks…