Rotate Object relative to camera postion
Hello, looking to figure out how to rotate an object to make it facing the camera forward/side vector for any direction the camera is facing.
Looking to have an object rotate as the camera moves positions
Any suggestions?
Thank you
jit.anim.node is always the answer for spatial relationships in 3d space.
the simplest technique is querying the camera's position, and sending that to the lookat attribute of anim.node. depending on the use case (e.g. if the target object is a plane), you may also want to enable tripod mode on the anim.node to keep the orientation "straight". You can use an secondary anim.node to apply whatever offset transforms needed as well.
for more complex animations, you should check out jit.anim.drive and the rotateto message.
(click on the window and use w, a, s, d, q, z keys to move the camera around)
That's close to what I'm looking to achieve.
I more so want to replicate third person video game movement. I am able to move the x,y,z position of the object depending on the camera position etc.
I'd just like to do the same thing with rotation
this video link will make it clear what the problem is. I would upload my patch but it is way too hectic to understand.
https://drive.google.com/file/d/1q79Acb-0-_eOTs26fLnc97sR9yaa3kEA/view?usp=sharing
there's no easy answer for these kinds of orbit cameras as character controllers. there is an example patch that ships with Max demonstrating how you can create this type of behavior, but it is quite complex (should really be ported to JS at some point I think).
search the File Browser for anim.camera.advanced.maxpat
press escape and then use w, a, s d keys to move the character and the mouse to orient.