Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Viper173

normal adjustment

This topic is 5774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

how can I rotate / scale / move my normals in my animation so that correct lighting will be possible? I guess that you have to multiply it somehow with the current matrix...??

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Viper173
I guess that you have to multiply it somehow with the current matrix...??


Yep, just like vertices but don''t use translation part from the matrix.

Share this post


Link to post
Share on other sites
that''s what I did...
here''s my code:

glGetFloatv(GL_MODELVIEW_MATRIX, @m);

V[1] := VertexNormals[1]*m[1,1] +
VertexNormals[2]*m[2,1] +
VertexNormals[3]*m[3,1] +
0*m[1,4];
V[2] := VertexNormals[1]*m[1,2] +
VertexNormals[2]*m[2,2] +
VertexNormals[3]*m[3,2] +
0*m[2,4];
V[3] := VertexNormals[1]*m[1,3] +
VertexNormals[2]*m[2,3] +
VertexNormals[3]*m[3,3] +
0*m[3,4];

V := NormalizeVector(V);
glNormal3fv(@V);

but it''s still screwed...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!