Doesn't look too bad to me. But why do you change the sign of the Y component in the normal? The signs should be like in the X and Z component.

[This message has been edited by Bob (edited 02-20-2002).]

Gavin

02-20-2002, 01:38 AM

Just by the by....

x *= 1/y
is the same as
x /=y

not being picky just the way I do it and you type 2 less characters! :-)

satan

02-20-2002, 01:55 AM

Originally posted by Gavin:
Just by the by....

x *= 1/y
is the same as
x /=y

not being picky just the way I do it and you type 2 less characters! :-)

yeah and after u used x,y and z as variable names you go on and name your other vars a,b,c... so you need only one character for any variable and not those damn long character names http://www.opengl.org/discussion_boards/ubb/wink.gif
not too serious but this is just one thing why i hate c/c++ so much

but anybody shall use what (s)he feels comfy with

lsdi

02-20-2002, 09:25 AM

A division its a liltle slower than a multiplication. This is why im using *=1/len
instead of /= http://www.opengl.org/discussion_boards/ubb/smile.gif

chxfryer

02-20-2002, 09:48 AM

But you are still doing a division with
blah *= 1/otherblah
this would be actually slower because you are doing the division and then another operation multiplication. if you used
1/otherblah more than once, precalculate it then use the multiplication way.