UpdateNormals()

Blitz3D Forums/Blitz3D Programming/UpdateNormals()

JBR(Posted 2008) [#1]
Hi, I understand that this command sets up the normals for use in lighting.

Do these normals have to be unit vectors (i.e. of length 1 unit) for lighting to be correct.

I'm thinking of calculating these normal myself as UpdateNormals() seems incredibly slow for what it does.

Thanks
Jim


big10p(Posted 2008) [#2]
I don't believe DX cares how long the normal vectors are, when used for lighting.


Ross C(Posted 2008) [#3]
Yeah, it doesn't. I think teh only reason to normalise the vectors is for ease of calculations with them?

You shouldn't need to use updatenormals() unless you've altered the vertices of a mesh, or you have built a mesh in a modeller and done some alterations to the normals.

btw, sswift wrote a much better updatenormals function in the code archives :o)


JBR(Posted 2008) [#4]
Thanks guys, looking at sswift code now.
Jim