|
|
everyone has explained it, here's my 2 cents. I have had to do this twice but
not in pov script (yet)
the normal for the vertex is the addition of the normals of all triangles that
share it. but you want a condition that supports limiting to an angle variable,
ideally.
first the triangle normal
#macro normal_vector(A,B,C)
#local result = vcross(C-B,A-B);
result
// 1
// |
// 2__ 3 vz points at you (neg) unless reverse y like pov, then
//
// 2__ 3
// |
// 1
#end
vcrossing 2 vectors is almost never a length of one, unless it is.
normalize for a length of 1.
pov renders 2-sided, so reverse normals are seldom an issue but do it right the
first time, if you want outside vectors, input is clockwise
Post a reply to this message
|
|