rather common for mesh objects to be used with some transformations,
like scale, rotate and
. In this case, the macro which computes the
edges would need to know the coordinates and normal of the mesh after
the transformation (and not those given in the definition of the mesh).
However, there is an efficient and cheap way to get the correct results
without computing these coordinates. As the edges depends only on the relative orientation of
the mesh and the point of view
, it is enough to apply the inverse transformation to the
point of view
One should not forget that when a
transformation is composed of several basic transformations, the inverse transformation is
given by the composition of the inverse of the basic transformations,
the reverse order !
Suppose you are applying the following
transformation to your mesh :
then PdV1 is obtained from the location
of the camera (called here PdV) as :
= PdV - <tx,ty,tz>; //inverse translation
#declare PdV1 = vrotate(PdV1,<0,-Yrot,0>);
#declare PdV1 = <PdV1.x/sx, PdV1.y/sy, PdV1.z/sz>;
Do not forget to apply the original
transformation to the edge object !
Note that if you apply different
the different meshes declared in your input file, you must
a different PdV1 for each mesh. To do so, edit the file
"declarations_mymesh.inc", uncomment the line "PdV1 = PdV;"
is right before each macro call, and define PdV1 as needed before each