realbasic-nug
[Top] [All Lists]

Re: RB3D Camera.position based on Object3d.postion

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: RB3D Camera.position based on Object3d.postion
From: Joe Strout <joe at inspiringapps dot com>
Date: Thu, 31 Jan 2008 08:09:09 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <47A005E9 dot 1040701 at radicalbreeze dot com> <1D6A4AF1-AD19-475B-8078-EDE99C414F36 at inspiringapps dot com> <47A166F0 dot 5050707 at radicalbreeze dot com>
On Jan 30, 2008, at 11:13 PM, Bryan Lund wrote:

> 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.)

Aha, this is a good point.  You do need to take into account the  
aspect ratio of the view, since the FieldOfView can't refer to both  
at the same time if your view isn't square.  I don't remember off the  
top of my head which it is, though (I think it may be the greater of  
the two dimensions, but I'm not sure).

In the Rb3D FAQ, I think there is some code to position something at  
any desired pixel position within an Rb3DSpace.  It's more complex  
than what we've discussed here, because it works for any camera  
position and orientation, but the basic idea is the same.  <http:// 
www.strout.net/info/coding/rb/>

HTH,
- Joe

--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>