Calculate 3D Coordinates of 2D Point

Software: Away3D 4.x

RIPI, Jr. Member
Posted: 13 June 2012 01:34 PM   Total Posts: 33

Hi!

I wonder if there is a possibility to calculate the 3d coordinates of 2d point on my screen. I know that there is a infinite number of solutions when transforming a 2d point to 3d-space, so i’d like to do it on a plane with y=0.

Any suggestions?

   

KobeJames, Newbie
Posted: 13 June 2012 01:53 PM   Total Posts: 21   [ # 1 ]

obj.project();
obj.unproject();

 

   

RIPI, Jr. Member
Posted: 13 June 2012 02:11 PM   Total Posts: 33   [ # 2 ]

Could you be a little more specific? I found these two methods but aren’t really sure how to use them.

Example: I have a camera, a Plane and a Sphere. The plane is used as a floor, where i want to position the sphere on it. But: i want the sphere to be on the left side of the 2d-screen (x=0) depending on a varying z-position in the scene. I thought about transforming the 3d z-position to a 2d y-position and then transforming this 2d Point (0,y) into 3d space with (x,0,z).

also i’d like to find the “right edge” of my screen, with x=1920 (2d space) what must be the x position of my sphere in 3d-space with a given z and y=0?

Thank you in advance, i hope my description is not too much confusing you wink

 

   

KobeJames, Newbie
Posted: 13 June 2012 02:37 PM   Total Posts: 21   [ # 3 ]

I’m sorry,English is not my mother tongue.. it confuse me too much:-S:-S
would you make it easy?

 

   

RIPI, Jr. Member
Posted: 13 June 2012 03:09 PM   Total Posts: 33   [ # 4 ]

Ok, i’ll try – it’s not my mothertounge either.. wink

I’ve attached an image to describe the problem better.

i am looking into a 3d-scene.
From a plane i take a certain z-value.

On my Screen i imagine a Point P, this Point is in 2d-space. Now, in the 3D-space, i would like to position a Object at the exact Position of Point P, but in 3D-Space. I already know the z Value (it’s z1 like in the image) and i know the y-value (its 0, because it is on a flat plane). what i need is the x-value.

So to say it short: i want to transform a 2d-x-value into the 3d-space.

Do you have any further ideas or explanations how to achieve this with project/unproject? Or anything else? like the FOV of the camera?

Thank you!

 

   

Griallia, Newbie
Posted: 13 June 2012 07:58 PM   Total Posts: 3   [ # 5 ]

Homogeneous Coordinates are what your looking for. I’ll need to study up on them tonight and then I’ll post an answer later.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X