Convert normal from object to world space
Properly doing this is a bit more complicated because it has to be normalized and pointing in the right direction. Just applying the inverse of the transform matrix doesn't quite do it.
This commit is contained in:
parent
cb0933ab51
commit
07e75c663d
1 changed files with 2 additions and 1 deletions
|
@ -88,7 +88,8 @@ Vector4
|
|||
Object::Normal(const Vector4& p)
|
||||
const
|
||||
{
|
||||
return FromObjectSpace(DoNormal(ToObjectSpace(p)));
|
||||
Vector4 norm = Transpose(mTranslation) * DoNormal(ToObjectSpace(p));
|
||||
return norm;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue