I am trying to create a sphere with particles randomly floating on its surface. It will move depends on the position on mousemove. something like this Strangely, it is only displaying one particle on canvas. I am debugging with console.log(vertices), but it clearly shows all the vertices in the array. My code in CodeSandBox Answer The problem is with your
Tag: three.js
How to make emissiveMap lighting only in dark areas in three.js?
With three.js, I render earth with textures. I also add an emissive texture to add the city light. But I have an issue, even the light areas of earth emit the cities light. Exemple: It is possible to render the emissive texture lighting only in dark areas? I don’t find any ways. My texture is set like this: Answer I’ve
Make HTML Content Clickable Over Three.js Content
I am making an animation with moving objects in Three.js. In this animation, I create a text bubble when an object is clicked, and it has an “X” button to close it. However, if the x button overlays a 3D Object from Three.js, then the button is ignored entirely and the 3D Object gets clicked instead. How can I avoid
ThreeJs scale object relative to another object
I’m using threejs to render some models (gltf/glb). All of them are of different sizes, some are big and some are small. Now I want scale all of them to the same size. if i use mesh.scale() that would scale the object relative to it’s own size. Is there any way to achieve this without manually calculating each model’s scale?
three.js over cdn using svelte or react
Is there any way of building my svelte or react application in a way, that the three.js module (which I usually import using npm) will be declared as a script tag which will call the module from a CDN? I would like to keep the advantages of a framework but also be able to reduce my final bundle size, since
React JS changing words in spherical word cloud
https://codesandbox.io/s/basic-demo-forked-yup2o?file=/src/App.js I have the above sandbox of a spherical word cloud consisting of random words – I’m trying to modify the code so rather than random …
ThreeJS Match GLTF Model To Size Of Bounding Box
I want to scale the imported GLB Model to the same size a cube in my scene. It is needed to make sure that the model stays inside the shadow casting areas and is big enough to make the shadows visible….
Three.js Materials are reversed depending on direction of view
I am using Three.js to model a home. The idea is that I can show the home to an architect and discuss it further. The project is supposed to be walkable, so I put together it all on this site. If you …
Using an Object’s postion for an Event in AFrame
I’m trying to make a component that checks the current position of a sphere in an AFrame scene and when it hits a specific coordinate and when it does it fires an event (In example below it resets it …
Three.JS: Move 3D cube with accelerometer data over x an y-axis
Following my previous post I am developing a 3D model that moves based on input from accelerometer and gyroscope sensors. The 3D model is written with three.js, and the input data for rotation and …