_new_horizon
04-14-2004, 02:51 PM
Greetings All;
I really need you're help. I'm working on a project which compares three methods of selecting (picking) objects on the screen using OpenGL. These are: OpenGL native selection, color-buffer coding and ray intersection, using triangle meshes loaded from files. Unfortunatly, I can't get the ray-intersection code to work 100% once the primitves have been *transformed*.
I need to transform the pick ray (which consists of a origin point and direction vector) by the *inverse* of the current primitive's transformation.Could someone show me how to do this using OpenGL under GLUT (no platform-dependant stuff please)? Each 'object' in my scene has both a transformation matirx and it's inverse stored as part of the class, so it should be simple...
I've heard that gluUnProject() could be useful, but I haven't had any success with that either.
I'm really stuck with this.
I really need you're help. I'm working on a project which compares three methods of selecting (picking) objects on the screen using OpenGL. These are: OpenGL native selection, color-buffer coding and ray intersection, using triangle meshes loaded from files. Unfortunatly, I can't get the ray-intersection code to work 100% once the primitves have been *transformed*.
I need to transform the pick ray (which consists of a origin point and direction vector) by the *inverse* of the current primitive's transformation.Could someone show me how to do this using OpenGL under GLUT (no platform-dependant stuff please)? Each 'object' in my scene has both a transformation matirx and it's inverse stored as part of the class, so it should be simple...
I've heard that gluUnProject() could be useful, but I haven't had any success with that either.
I'm really stuck with this.