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: Bryan Lund <bryan at radicalbreeze dot com>
Date: Thu, 31 Jan 2008 13:07:41 -0800
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>
Joe Strout wrote:
> On Jan 31, 2008, at 1:26 PM, Bryan Lund wrote:
>> But it seems to not return consistent results at different camera
>> positions.  If I return the x/y of the returned vector of a known
>> location of an existing 3d object, then modify the camera.position.x
>> (say, to slide it to the right a bit while still keeping the object
>> visible), the next time I return the x/y of the vector of that same
>> known location... it's now a different value.
> 
> Well, of course it is.  The point of this function is to give you a  
> world position that corresponds to some screen position.  If you move  
> the camera, then of course the world position for a screen position  
> changes too.
> 
> I'm not sure what "of the returned vector of a known location of an  
> existing 3d object" means, but I'm sure that your overall description  
> -- that when you move the camera, the result from this function  
> changes -- makes perfect sense.

Sorry, I should have been more clear.

If I move the camera and get the new results from the screenToWorld 
function, even in cases where I would expect the x/y to be the same, it 
is not.

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?

-Bryan

_______________________________________________
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>