How exactly can a world to screen be implemented without knowing all of the matrices involved in rendering?
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.
gluProjectsimply applies all of the given transforms to the point passed. If you pass it the wrong transforms or the wrong point, you will get the wrong result.For example, if you want the screen coordinate of the centre of an object, assuming that the objects untransformed coordinates are centered in (0,0,0), you can
gluProjectthe coordinates (0,0,0), the modelview transform in effect when drawing that object, and the usual for projection and viewport.and PLEASE use the standard constants! Using
2892and similar in your code when there are perfectly good constants likeGL11.GL_MODELVIEW_MATRIXmakes baby Jesus cry.