Jump to content

  • Log In with Google      Sign In   
  • Create Account


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.

  • You cannot reply to this topic
6 replies to this topic

#1 Jesper T   Members   -  Reputation: 322

Like
Likes
Like

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.

Sponsor:

#2 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 14 September 2001 - 09:38 AM

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

#3 masonium   Members   -  Reputation: 118

Like
Likes
Like

Posted 14 September 2001 - 12:39 PM

do you mind a little detail about that function?



#4 ECKILLER   Members   -  Reputation: 122

Like
Likes
Like

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

#5 masonium   Members   -  Reputation: 118

Like
Likes
Like

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?

#6 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 14 September 2001 - 04:59 PM

download the opengl1.3 spec from www.opengl.org
also check here its pretty selfexplanatory
http://www.cevis.uni-bremen.de/~uwe/opengl/gluProject.html

#7 Jesper T   Members   -  Reputation: 322

Like
Likes
Like

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.



PARTNERS