   Normals with every pass?
  Hi,  Would it be possible for you to check over my tutorial on calculating normal vectors?Also, I have been wondering.  Do you need to compute new normals with every pass when you are rotating/translating your objects.  I am doing that in the tutorial, but I'm not sure if I should be.  Levi[Edited by - levjs on December 12, 2005 10:42:07 AM]
  Normals are (as are every direction vectors) invariant to translation, but they are not invariant to rotation. However, you could pre-compute and store normals in the same co-ordinate system as the position vectors (e.g. of vertices) and transform them similarly (but not identically) like position vectors. Say: if you translate a mesh you usually don't do so by translating each particular vertex but by translating the local co-ordinate frame of the mesh.[Edited by - haegarr on December 12, 2005 12:33:29 PM];  So it is not bad practice to compute normals with every pass when you are going to be rotating your objects?? ;  Well if ur using OpenGL to render then you dont need to recompute the normals since they are multiplied by the Transformation Matrix   ;Quote:Original post by levjsSo it is not bad practice to compute normals with every pass when you are going to be rotating your objects??Let it say me this way: The user will not thank you for wasting CPU cycles if you compute 50 times per second a couple of hundrets of normals without need. Computing _some_ normals does not count usually. If the circumstances make it necessary, then you have no choice, of course.   ;  if you rotate a model the fixed function pipeline will do this for youif you are using vertex shaders you have to use the rotation matrix and rotate them on your own;  Ok, I believe I understand thanks everyone.  Levi   ;  If the shape of the object does not change, then the normals won't change. However, if you deform the object (move vertices) then normals change.Most people apply rotation and translation when they render or test against their geometry, by applying a matrix at that point. The normals should then be transformed through the upper-left 3x3 part of the transpose of the inverse of the matrix you use to transform the vertices -- typically, the graphics API will take care of this for you. If there's no scaling, then the transpose of the inverse is the same as the original matrix for the upper 3x3 part, btw.;  Ok, : ) ThanksBy the way, has anyone looked at the tutorial.  I just want to make sure that the math is right and that it looks ok otherwise. Levi   ;  I don't claim to have checked your tutorial in depth and seen all and everything, but I will mention these points:(1) In the text above Figure 1-1:Quote:You don't need to know a lot about this for this tutorial, but you do need to know that a vector's components, when added, result in the vector itself.That is wrong. A vector's components are scalars, and adding scalars result in another scalar, not in a vector. What you mean requires the knowledge of what a vector basis is. In fact, the vector's components are defined by using a linear combination of the basis vectors, and the weights of that combination give the components of the vector.Perhaps you may avoid to burden the reader with a vector basis, so you may take into account to drop that sentence.(2) All that vector stuff you mention there works well if dealing with direction vectors (as normals are). In the case of position vectors there are some differences.(3) In the text below Figure 4-1:Quote:As shown here, the normal for a plane such as the one above(which would be the right face of a cube)has only one dimension. That is, if you were to split it into components, the x component would be the vector itself, and there would be no y or z component.IMHO this is not correct. The normal has still 3 dimensions since that are the dimensions of the space (i.e. count of principal axes of the vector basis, if seen mathematically) the vector is defined in. See above.I have not looked at the code since I assume you have tested it thoroughly.BTW: IMHO you are on the right way. Good luck.   