View Full Version : Ray Picking base DX8.X and OpenGL

04-23-2003, 07:05 AM
I am working on developing a 3D rendering engine base both DirectX8.0 and OpenGL,which allow user to select between the two 3D API. I am programing on Win2K+VC++6.0 environment.Now I want to implement ray picking objects by mouse and the objects would be transformed in world space.I known there is a sample about Ray Picking with Object Transformations,following:

But I don't known how I can implement same function base OpenGL because there is no independent world and view transformation matrix can be get.Can anybody give me some hints about this?The key problem I want to solve is how to convert 2D mouse to a 3D ray.
Then I can test intersection between the objects of scene and the ray and determine the selected objects.

Thanks in advance
Best Regards

04-23-2003, 07:42 AM
OpenGL has "picking" commands that might be easier (and faster?) than trying to do what you suggest. But I really have no idea since I'm fairly new to this. GameTutorials.com has some demos that show how to test for collisons, but I don't know if those will help you.