Skip to content
Advertisement

Tag: three.js

OrbitControls on a shared camera cannot handle panning

I am trying to create two renderers on two different div containers. Each renderer wish has its own OrbitControls for updating the associated camera. The camera is shared between the two renderers. The goal is to sync the camera for OrbitControl (so that two containers can have the same camera view) and render between the two render loops. I noticed

my three.js scene is not rendering. not sure why

my main.js file contains :- and my index.html :- All that appears on my screen is :- [what displays on my browser][1] [1]: https://i.stack.imgur.com/PQmJu.png I checked and my main.js file is definitely executing, but nothing is rendering on the screen Answer You have a few issues. This would select elements with the class canvas, but your DOM has no such

only one particle showing in the scene with three.js

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

Three.js extrude vertically

I am new to three.js and I want to extrude a shape vertically. I can set the points of the 2D shape, but when I extrude it, the extrusion happens along the z axis. I want to extrude the shape along the y axis, how can I make this happen in the simplest way?(In this example I know could use

Javscript – Three.js Disable panning on mobile devices?

So I’m making a 3d project with three.js. Everything works as expected on my laptop. I’m using OrbitControls to allow camera movement, but i have disabled right click panning, because I want the camera just to rotate. When switching to a mobile device (iphone), using two fingers I’m able to move the camera (not rotate). Is there a way to

Advertisement