Joe Strout wrote:
> On Jan 29, 2008, at 10:06 PM, Bryan Lund wrote:
>
>> What I'd like to do is figure out what X and Y values I need to assign
>> to the camera.position in order to place the Object3D at the edge
>> of the
>> RB3DSpace view (so that it's flush with the border). And I'm just not
>> good at 3D math. :)
>>
>> Anyone have a bit of experience here and would mind pointing me in the
>> right direction?
>
>
> I've done this sort of thing, and there's no shortcut for it -- you
> just have to do the trig. Fortunately, you don't need 3D math, but
> only 2D. Draw a triangle where the long side is the Z distance to
> the object, and the angle is half the Rb3DSpace's FieldOfView. Then
> do the trig (using Atan) to determine the short side; that's your X
> value. Y value shouldn't matter, assuming you want the object placed
> on the left or right side of the view.
Thanks Joe! That's exactly what I was looking for.
Basically what I'm now doing is something like this:
ShortSide = tan(degreesAsRadians) * LengthOfAdjecentSide
Is this the correct approach to take no matter with the width of the
rb3d space is? (As the viewable area changes depending on the width of
the RB3DSpace no matter what the field of view is set to.)
-Bryan
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|