PDA

View Full Version : Normal Vector under the mouse cursor



Sitara
08-28-2003, 06:35 PM
Hi there

I was wondering if someone can please help me with the following question:

I have a surface on the screen rendered with glquads. When the mouse cursor is over a point i can get the coordinates of the vertex using glUnproject. Is there a way that i can get the normal vector under the mouse cursor as well??

any advice will be MUCH appreciated!!

thank you in advance

mikael_aronsson
08-28-2003, 09:44 PM
Hi !

You cannot find the normal of a vertex because it does not have one, to find a normal of something you need 3 vertices, you can find the normal of a triangle, quad and so on, but in that case you could use picking to find the triangle, quad or whate ver that is under the mouse and then you can find the normal of that object.

Mikael

Sitara
08-29-2003, 05:33 AM
Thanks for your reply


so would i need to have a look up table of some kind?

Do you know of any example code out there that can help me to get started?