POV-Ray : Newsgroups : povray.newusers : Need hepl with vector math Server Time
31 Jul 2024 02:32:14 EDT (-0400)
  Need hepl with vector math (Message 1 to 3 of 3)  
From: Will W
Subject: Need hepl with vector math
Date: 22 Apr 2003 01:52:19
Message: <3ea4d893@news.povray.org>
Is there a function "magicnormal" such that if A, B, C are points,
magicnormal(A, B, C) will return the normal vector to the plane defined by
A, B, and C? I have looked through the POV sections on functions and macros
that return vectors and I didn't see anything, but maybe I'm not looking in
the right place. It seems to me POV must be doing a lot of this sort of
calculation during rendering.

If there is no such built-in function, I would appreciate any thoughts on
how to do this efficiently.


Background (in case anyone is interested): I'm building a CSG object within
a macro and need to carve out a concavity in one of its "faces". Points A,
B, and C are dependent on the values fed to the macro, and I also expect
their orientation to change when I start tweaking things upstream. About all
I can be sure of is that the sphere I'll use to carve the face will lie on
the line that is normal to the center point of the face.

 Any thoughts appreciated.


--
Will Woodhull
Thornhenge, SW Oregon, USA
willl.at.thornhenge.net


Post a reply to this message

From: Pyry
Subject: Re: Need hepl with vector math
Date: 22 Apr 2003 04:45:04
Message: <web.3ea500e1700599c11b82ee40@news.povray.org>
Will W wrote:
>Is there a function "magicnormal" such that if A, B, C are points,
>magicnormal(A, B, C) will return the normal vector to the plane defined by
>A, B, and C? I have looked through the POV sections on functions and macros
>that return vectors and I didn't see anything, but maybe I'm not looking in
>the right place. It seems to me POV must be doing a lot of this sort of
>calculation during rendering.
>
>If there is no such built-in function, I would appreciate any thoughts on
>how to do this efficiently.
>
>
>Background (in case anyone is interested): I'm building a CSG object within
>a macro and need to carve out a concavity in one of its "faces". Points A,
>B, and C are dependent on the values fed to the macro, and I also expect
>their orientation to change when I start tweaking things upstream. About all
>I can be sure of is that the sphere I'll use to carve the face will lie on
>the line that is normal to the center point of the face.
>
> Any thoughts appreciated.
>
>
>--
>Will Woodhull
>Thornhenge, SW Oregon, USA
>willl.at.thornhenge.net
>

Here's a thought (ie. not tested idea).
try
vnormalize(vcross(B-A,C-A))


Post a reply to this message

From: Will W
Subject: Re: Need hepl with vector math
Date: 22 Apr 2003 16:06:04
Message: <3ea5a0ac@news.povray.org>
"Pyry" <fro### [at] suomi24fi> wrote in message
news:web.3ea500e1700599c11b82ee40@news.povray.org...

<snip>

> Here's a thought (ie. not tested idea).
> try
> vnormalize(vcross(B-A,C-A))
>

That works. Thanks.


--
Will Woodhull
Thornhenge, SW Oregon, USA
willl.at.thornhenge.net


Post a reply to this message

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