d3d_model_vertex_normal_texture(m, x, y, z, nx, ny, nz, xtex, ytex);
Could someone help me understand how normal vectors affect lighting on my model? I've looked through a couple tutorials and forum discussions, and they've told me how to calculate the normals, but not exactly what they will do. I understand if all my vectors are pointing up, my model will look flat. I don't know how adjusting them will affect the lighting on the model though.
each point has a vertex normal. they point in the direction, perpendicular to the plane of the facet they are the corner of... in its most simple implementation...
this tells the direction the light reflects, roughly speaking.
each point of the triangle can have it's own vector, as opposed to the entire triangle defining the reflection vector, which allows smoothing... or rounding things by smoothing the lighting..., like each vertex on the cannon has its lighting normals point outward at an angle matching round cylinder for example
Generally speaking, the normal vector is the "up" direction of the plane the triangle is in. It's useful for lighting, but it's also important in collisions. For instance, the normal vector of a wall is close to horizontal, the normal vector of a floor points upwards, and the normal vector of a ceiling points downwards - so checking the z component of the normal vector can tell you how to collide with a triangle.