Game Development Community

Surface Normal to Matrix

by Demolishun · in Technical Issues · 10/03/2006 (8:07 pm) · 1 replies

I need to build a matrix that is based upon a surface normal so I can convert a world vector to a vector relative to the surface normal. What I do not understand is what a normal represents. Is this something I can just plug into the matrix in a row or column or does it represent a euler angle, axis angle, etc?

Thanks,
Frank

About the author

I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67


#1
10/07/2006 (11:03 pm)
Got it:
assume vector A and normal N
'X' is cross product
solve for vector B which is rotated 180 deg around N z axis

R = A X N
B = R X A

Sometimes it is just so simple.