Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Model Normals Don't Transform ?

This topic is 3801 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

Hi guys, I transform my model like this: D3DXMATRIXA16 mRotation; D3DXMatrixRotationY(&mRotation,angle); D3DXMATRIXA16 mTranslation; D3DXMatrixTranslation(&mTranslation,...); D3DXMatrixMultiply(&worldMatrix,&mRotation,&mTranslation); ...but it doesn't rotate my vertex normals. Is that the way it's supposed to be ? I can transform them right in my vertex shader, is that the normal way of doing things ? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
In your vertex shader you want to multiply your normal by the rotational portion of your world matrix. The easiest way being to cast your world matrix to a 3x3 matrix. Multiply your normal by the 3x3, then renormalize the normal. This isn't a perfect solution but should work for the most part.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!