another angle quest

Blitz3D Forums/Blitz3D Programming/another angle quest

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.

The normal wont update until you call updatenormals


You're talking about vertex normals, which are completely different from triangle normals. A triangle normal is a mathematically derived vector describing the angle the triangle is facing. It is calculated from the positions of the triangle's vertices and nothing more.

A vertex normal is a programmatically derived vector describing the angle the vertex is supposed to look like it's facing. Vertex normals are set by hand and can be tweaked. They are simply a property of a vertex and do not even need to be normalized. They're used for lighting, to make a triangle look rounded instead of flatshaded.

Look at the code I posted above and you'll see it isn't using VertexN*() functions, or for that matter, any functions other than Sqr().

Incidently, UpdateNormals() sets all the vertex normals in a mesh to be the average of all the triangle normals the vertex belongs to - or, more accurately, is positioned on the corner of.

also the vertex routine above, how do i work out the angle from it or is that slope


The use of ACos() above turns the vector component into an angle.