Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMJP

Posted 25 December 2012 - 12:36 PM

i dont use seperated model and view matrices on my projects. but a combined modelview matrix. so to me your missing one multiplication. other things i do it not cast to a float3x3 but to set the normal's w component to 0 and multiply with a float4x4. if for some reason your normal's w component was non-0 your light would be very much mucked up.


Casting the matrix to a float3x3 will give you the same exact result as converting the normal to a float4 with a w-component of 0.

@KaseiFox It's very hard to tell what's wrong with your image without knowing exactly how the object is being rotated, or how you're intending to rotating it. I would assume that you're changing rot.x, rot.y, and rot.z in some way each frame, so why don't you post that code as well?


#1MJP

Posted 25 December 2012 - 12:34 PM

i dont use seperated model and view matrices on my projects. but a combined modelview matrix. so to me your missing one multiplication. other things i do it not cast to a float3x3 but to set the normal's w component to 0 and multiply with a float4x4. if for some reason your normal's w component was non-0 your light would be very much mucked up.


Casting the matrix to a float3x3 will give you the same exact result as converting the normal to a float4 with a w-component of 0.


PARTNERS