G
G
GF2020-09-27 20:45:01
JavaScript
GF, 2020-09-27 20:45:01

How to rotate objects in threejs using mouse?

Let's say I have 3 cubes on the same canvas that I want to rotate. Is it possible to make a rotation of a particular object? Or is it possible to rotate only the camera? to make 3 rotating objects will i need to create 3 separate scenes?
5f70cf947ae01923431390.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stranger in the Q, 2020-09-29
@fomenkogregory

You can, but you will need to manually try to determine what kind of object you are going to rotate.
For example, you can divide the screen into 3 areas, cover them with transparent elements, and already hang mouse listeners on them, which will rotate objects.
Or, option 2: hang one listener, but analyze the coordinate by X, determine which of the thirds of the screen it hit when the drag was started - rotate that object and rotate it.

R
Rerurk, 2020-09-27
@Rerurk

here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question