   How to rotate an UNNORMALIZED vector around the normal??
  Hi, It's me again. This time I need to rotate a vector which is NOT normalized around the normal vector. I know the equation to compute the vector R in the Phong illumination-model. But that one works ONLY if both vectors are normalized. Here it is: R = 2*N*dot(N,V) - V;   Unfortunately my vector V isn't normalized. The result mustn't be either. Does anybody knows a way how to compute the rotation without an normalized vector V??[edited by - Data2 on February 9, 2004 11:13:34 AM]
quote:Original post by data2  Hi, It''s me again. This time I need to rotate a vector which is NOT normalized around the normal vector. I know the equation to compute the vector R in the Phong illumination-model. But that one works ONLY if both vectors are normalized. Here it is: R = 2*N*dot(N,V) - V;    Unfortunately my vector V isn''t normalized. The result mustn''t be either. Does anybody knows a way how to compute the rotation without an normalized vector V??R = 2*N*dot(V,N) - Vthat should work, even if V is not normalised. It would be a problem if N was not normalised. in that caseR = 2*N*(dot(V,N)/dot(N,N)) - Vor am I missing somehting... ;  just so i''m clear... are you talking about rotating vector V by 180 degrees around the axis defined by the unit vector N?In which case i would have to agree with Oliii, it should work no matter how long your vector V is as long as N is of unit length. ;  ... is there a reason you can''t cache the length of your vector, normalize, rotate and re-scale? And having done that, you can write out the equation for the whole process, and simplify. ;  whoa whoa whoa...is there something I''M MISSING?  You''re talking about doing rotations and normalizations as a part of a lighting calculation in real time?  Don''t you think that would kind of like, run a little slow?  I mean a certain amount is necessary but that just seems overkill to me. ;  shaders do that. ;  In fact I''m not talking about lighting, but something with a similar computation. And indeed, shaders do that 