Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > OpenGL 3D API > Re: Opengl find...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 4887 of 5017
Post > Topic >>

Re: Opengl finding direction vector

by "jbwest" <jbwest@[EMAIL PROTECTED] > Aug 25, 2008 at 06:29 PM

<onur.tugcu@[EMAIL PROTECTED]
> wrote in message 
news:27339759-c355-44c6-afd1-28dc0b181de4@[EMAIL PROTECTED]
> Hi all,
>
> I've written different "camera" codes, one uses spherical polar
> notation with two angles, the other one uses a quaternion for
> rotation. However I feel like I'm missing out on something. So many
> calculations are done by the opengl library, so I should be able to
> make use of at least some of them.
>
> So the question is, is there any way that I can glRotate and find the
> current internal direction vector or orientation matrix? glGet
> GL_CURRENT_NORMAL always gives me 0, 0, -1. I think there should be a
> way to calculate the real (non-relative) normal vector of a polygon
> surface, maybe use that polygon to find the camera normal vector.
>
> Perhaps there is a GLSL way? I haven't looked into that one yet.
> Thanks for your attention.

Normals aren't something computed by OpenGL - ever. You supply any normal 
you want for a triangel solely for the purpose of lighting. If you want
the 
"real" normal, just apply the current transform (gluproject()) to a
computed 
"relative" triangle normal *that you supply*. Not really sure what you
mean 
by "camera normal".  To get the direction vector, just gluproject whatever

vector you are wanting to get, to get a projected vector.

-jbw
 




 4 Posts in Topic:
Opengl finding direction vector
onur.tugcu@[EMAIL PROTECT  2008-08-25 12:24:55 
Re: Opengl finding direction vector
"jbwest" <jb  2008-08-25 18:29:22 
Re: Opengl finding direction vector
fungus <openglMYSOCKS@  2008-08-25 20:47:25 
Re: Opengl finding direction vector
mi76 <mi333@[EMAIL PRO  2008-08-26 16:35:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 6:09:04 CST 2008.