# How to Obtain x,y,z Coordinates from a 3-D space?

• 02-29-2012, 07:26 PM
JeffThomas
How to Obtain x,y,z Coordinates from a 3-D space?
How would I go about creating a method of obtaining the (x,y,z) coordinates from a 3-D environment? I'm developing a 3-D game, and was wondering about a couple of things.

I was gathering normal x,y pixel locations while moving around in the game in FPV and encountered weird results. :frusty:
• 02-29-2012, 07:29 PM
doWhile
Re: How to Obtain x,y,z Coordinates from a 3-D space?
x,y,z coordinates of what?
• 02-29-2012, 07:33 PM
JeffThomas
Re: How to Obtain x,y,z Coordinates from a 3-D space?
x,y,z coordinates of pixels (voxels?) in the 3d environment.
• 02-29-2012, 07:43 PM
Norm
Re: How to Obtain x,y,z Coordinates from a 3-D space?
Since the screen is only 2D, to get 3D coordinates I'd think you would have to build a complete 3D representation of what you want to be the 3d environment. Past of that should be a way to get a x,y,z value for a location.
• 02-29-2012, 07:50 PM
JeffThomas
Re: How to Obtain x,y,z Coordinates from a 3-D space?
Well if it isn't norm, my favorite moderator. :)

I've got the 3-D environment created, camera actors,velocities, and angles made out but I didn't use any java for that. I was looking at the java 3D library API though,
Java SE Desktop Technologies - Java 3D API
• 02-29-2012, 07:50 PM
doWhile
Re: How to Obtain x,y,z Coordinates from a 3-D space?
A 2D coordinate can have virtually an infinite number of 3D coordinates. From recollection, this is usually done through picking in which you pick an object in the 3D space based upon the 2D coordinate - since translating the objects from 3D to 2D is done with the drawing, the reverse can be performed to get the picked object. Many 3D librarys have some type of picking support.
• 02-29-2012, 07:56 PM
JeffThomas
Re: How to Obtain x,y,z Coordinates from a 3-D space?
Thanks.
I think I'll just have to get the right transformation matrix for the model.