Help needed calculating vertex normals...

Blitz3D Forums/Blitz3D Programming/Help needed calculating vertex normals...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi

Hope it's OK posting here as I'm not sure my problem can be considered 'advanced 3D' but here goes...

Basically, I've written a function to do tri sub-division by placing a new vertex at the centre of each side of a tri. The problem I'm having is calculating the normals of the new vertices. The calculation I'm using at the moment to do this is as follows:

norm_x_of_centre_vert# = norm_x_of_vert_0 + ((norm_x_of_vert_1-norm_x_of_vert_0)/2)
norm_y_of_centre_vert# = norm_y_of_vert_0 + ((norm_y_of_vert_1-norm_y_of_vert_0)/2)
norm_z_of_centre_vert# = norm_z_of_vert_0 + ((norm_z_of_vert_1-norm_z_of_vert_0)/2)

I think this gives the new normals the right direction but it also 'crops' them so that they don't have a length of 1. I'm pretty new to 3D concepts so don't really understand why normals have to have a unit length.

Any help sorting this problem out would be much appreciated!

Thanks in advance.