Model Normals Don't Transform ?
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement