POV-Ray : Newsgroups : povray.general : normals function : Re: normals function Server Time
2 Nov 2024 17:18:26 EDT (-0400)
  Re: normals function  
From: Tim Nikias v2 0
Date: 9 Jan 2004 21:13:53
Message: <3fff5fe1$1@news.povray.org>
> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.