Keeping object with vertical position aspect (rotation angle) on screen turning camera?

Hi all,

I’m looking for a way to keep an object vertically (regarding the screen) when the user turn the camera. The idea is to modify rotation (x, y and z) of the object when the user turn the point of view with OrbitControl. To summarise, how to know the x,y, and z rotation to affect to and object (which is by default to 0,0,0) to be sure that it stay vertical like a pendulum when the user turn the point of view ?
Thanks for your help !

I just add a picture to explain the idea correctly…

This rotation?

Realy sorry, but i don’t understand. On your example, the camera doesn’t move. The idea is to be able to move the point of view (OrbitControls) but keeping the object looking to bottom of the screen like in the picture below…?

Go to codepen to move camera. WASD

Thank you for your respone Chaser_Code. Unfortunatly, that’s exactly why i need. Or i didn’t clearly understand what you want to explain to me. In my case, i need to be able to rotate around the object but keeping always the y rotation adapted to look at the bootom of the screen… But thanks for your try !!

Provided control.target and mesh.position stay coincided.
Some where in your animation loop:

Object3D.quaternion.copy(camera.quaternion);

Working Demo: Ray_Muti.html (5.7 KB)

Edit: Forgot to mention, to toggle rotation lock press letter L on keyboard.

THANKS A LOT rrrr_rrrr ! That’s exactly what i was looking for !

My pleasure.