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 13:59:17 -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>
On Jan 31, 2008, at 1:26 PM, Bryan Lund wrote:

> I pulled the example code below from the faq (I assume that kDegrees =
> 0.0174532925).

Check the sample projects that come with the text.

[Re. the ScreenToWorld function...]

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

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>