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 16:23:31 -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> <F14EB11A-1352-4C70-9AAF-DB522140B16D at inspiringapps dot com> <47A21347 dot 3060802 at radicalbreeze dot com> <47A22EEF dot 3090005 at radicalbreeze dot com> <8692D891-1BDC-4BEB-A4C2-884C7ADE2D2C at inspiringapps dot com> <47A2389D dot 10805 at radicalbreeze dot com>
On Jan 31, 2008, at 2:07 PM, Bryan Lund wrote:

> If I add an object.  And do not move that object.  Then shouldn't the
> result of the ScreenToWorld function (when I mouse over that object in
> order to pass in the x/y parameters) return the same x/y/z no matter
> what the x/y of the camera.position is?

No.  Consider that for any position on the screen, there are an  
infinite number of positions in 3D space that map to it -- more  
specifically, all the points along a line between the camera and that  
point in the screen.

The ScreenToWorld function arbitrarily picks one of these (in a plane  
close to the near clipping plane).  So the position it returns should  
be in the same line as some 3D object you're mousing over, but won't  
generally be the very same point.

But of course, if your purpose is to determine what object (or  
position on an object) you're mousing over, then you should be using  
Rb3DSpace.FindObject or .FindPoint anyway.

Best,
- 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>