I drawn points in a window and used the select mode method shown in the “red book” to select them. But after I rotate those points, I am not able to select them again. I am new to opengl, so could someone teach me specificly how to do this?
Selection should work with rotation. You have probably made a simple mistake somewhere.
Here’s some code that works:
Maybe this will help you spot any mistakes, like not setting the pick matrix properly.
Yes, your seguession helps. I didn’t multiply the rotation matrix before setting the pick matrix. It works fine now. Thanks for your reply.
Hey Chenghuayan, glad that helped.
It sounds like you building the modelview on the projection matrix stack, or something. That can work, but you might run into trouble with lighting, among other things.
Just so you know, you can set up the camera and object transformations just as you would without picking. The trick is applying the pick matrix transform before the usual projection matrix setup.
// Begin frame
… camera transforms as usual
… object transformations as usual
(Don’t forget to push and pop the camera)