View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# converting 3d coordinate to 2d raster position.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1Jesper T  Members

Posted 14 September 2001 - 05:03 AM

Im making a small prog to make 3D models in, with curved spline patch surfaces based on a few control points. When making large models, the amount of control points makes it hard to select/mark specific points for manipulation with just using keyboard commands etc.. I need to be able to click on a point (which I only have the 3D coordinate of) with the mouse to select it. I know how to detect mouseclicks, but I cant find out how to get the pixel coordinate on the screen of a given 3D coordinate in the scene. I''d appreciate it if anyone could help me with this.

### #2zedzeek  Members

Posted 14 September 2001 - 09:38 AM

gluProject(..) will tell u in screen coords a world coords position

### #3masonium  Members

Posted 14 September 2001 - 12:39 PM

do you mind a little detail about that function?

### #4ECKILLER  Members

Posted 14 September 2001 - 12:48 PM

This is called "picking", do a search on the web for an algorithm. Basically you have to take the inverse of the projection matrix to recover the original 3D point. This is covered in most gfx texts.

ECKILLER

### #5masonium  Members

Posted 14 September 2001 - 01:42 PM

I mean.....how would I go about implementing that function? How would I know where, for example, a cube at coordinates (1, 2, 3) was in terms of the screen?

### #6zedzeek  Members

Posted 14 September 2001 - 04:59 PM

also check here its pretty selfexplanatory
http://www.cevis.uni-bremen.de/~uwe/opengl/gluProject.html

### #7Jesper T  Members

Posted 14 September 2001 - 07:33 PM

gluProject(..) ok, right thanks

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.