On Jan 31, 2008, at 4:17 PM, Bryan Lund wrote:
> Thanks David, also very helpful.
>
> Since, the FieldOfView applies to whichever is smaller (the height or
> the width) of the RB3dSpace, how would we do a similar calculation for
> the longer side?
>
> At that point is it pretty much just a matter of calculating for the
> short side with the FieldOfView, then determining the Height to Width
> ratio to determine the actual location? (Or is there a more proper
> way
> of going about it?)
>
> Thanks again for the help guys.
Hi Bryan -
You should be able to do the calculations for the shorter value and
then multiply by the aspect ratio of the rb3dspace. For the sample
code I gave you, try making the control 400 pixels wide and 200
tall. Then where this code was:
//Default field of view is 50°, half that is 25
//tangent of 25° is .4663, multiply by 100
//which is dist from camera to get 46.63
//46.63-30 = 16.63
Rb3DSpace1.Camera.Position.x = 16.63
Multiply 46.63 * 2 (which is the aspect ratio) = 93.26
93.26-30 - 30 = 63.26, so change the last line to
Rb3DSpace1.Camera.Position.x = 63.26
Best regards, David
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|