|
|
> Does povray have a built in function to calculate the norm of a triangle
> from 3 vectors?
>
> If not how whould I do this. I am not finding or understanding how to do
> this.
It's actually very easy with POV-SDL when you know where the three corners
are: First, generate two vectors: Point 2 minus Point 1, that's Vector one,
and Point 3 minus Point 1, that's Vector 2. Now, use vcross(Vector1,
Vector2) and voila! You've got the surface normal.
With a little research using google and the internet, you'd find more
insightful information, but that's simply a basic approach.
vcross calculates the cross-product of two vectors, which is actually a
vector, which is perpendicular to both given vectors. And how did you get
these? Subtracting one point from another calculates a vector which is
actually the direction and distance from Point 1 to point 2 and 3 (when you
do Point3-Point1, its actually "going from Point1 to Point3" what you get,
hence subtracting the same point from the other two, but that doesn't really
matter for the cross-product).
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
Post a reply to this message
|
|