I have a scene with basic geometry (pick demo) I want when I select any object to return the x,y and z of the mouse cursor otherwise return -1
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The general OpenGL technique is to use gluUnProject() which takes screen x,y and the z-value of the depth-buffer and reverse-transforms that into world (or view) coordinates.
See NeHe’s tutorial on how to use it in a general OpenGL app. It should hopefully get you started in the right direction with your Delphi app.