Setting camera from 3D scanner

 From:  Michael Gibson
8566.9 In reply to 8566.6 
Hi track,

> The viewing direction expressed in the 3D world is rz, the "up" vector is ry and the "right" vector is rx.
>
> Today in Moi, I can set the position, the target and the field of view. But I don't know how to handle the
> leftRightAngle, upDownAngle and tiltAngle to get the same orientation.

So hopefully this is correct, I'm not thoroughly double checking it at the moment, but once you have set the position and target in MoI the viewing direction should match your rz and that also means you don't want to mess with the leftRightAngle and upDownAngle after that since they are alternate ways of setting the viewing direction.

Then tiltAngle will control the "up" direction's rotation around the view direction with respect to the world z axis direction.

The way the tilt angle is calculated is like this:

TempRight = CrossProduct( ViewDir, WorldZAxis )
if (TempRight.isDegenerate() )
TempRight = CrossProduct( ViewDir, WorldYAxis )

TempRight.Normalize()

NoTiltUpDir = CrossProduct( TempRight, ViewDir ).Normalize();


That's what will be the view's up direction for a "tiltAngle" of 0, you'd need to measure the angle between your view's up direction and that to get the angle to set to make them match.

Hope that helps!

- Michael