Notifications
Clear all

[Closed] rotating camera and object positions

 rdg

I have a camera that rotates around its local z axis – I animated the roll-parameter.
How do I calculate if an given object is left or right of the camera center at a given frame?

Is this way correct:
I calulate the angle between the loca z axis of the object and the loca y axis of the camera against a plane defined by camera.pos, object.pos and the camera local x axis?

**edit:
to make it even more interesting:
I realise that my objects are rotated around an aritrary axis, so their local z axis is of no use …

** edit

Georg

3 Replies
 rdg

this helped : camera view and projection matrices

as I just need some quantitiv values.

Georg

in coordsys MyCamera, at time t (local PosInCamSpace = MyObject.pos)

–if (PosInCamSpace.x <0) then the object is to the left of the camera center.
–if (PosInCamSpace.x >0) then the object is to the right of the camera center.

 rdg

😮
This was my first attempt … I nested the coordSys & at time stuff in an invalid way and it returned always the same position …

thank you !