rotate an object relative to a camera

Hi,

i’m trying to rotate an object relative to the camera’s forward axis, so that from the cam’s POV it looks like a roll. There has to be a proven way to do this, right?

I’m new to Quaternions, Euler angles and all that so if someone could help me out i’d be very thankful!

edit: i should add that both the camera’s and the object’s position in the world currently can vary (the cam can orbit around the object, and the object can be panned around in front of the cam), i hope this doesn’t make the equation more difficult.

alt text

camera’s POV:

alt text

You can use transform.RotateAround on the object for this, using the Camera’s forward vector for the axis, and its position for the rotation point.