POV-Ray : Newsgroups : povray.newusers : how to calculate.... : Re: how to calculate.... Server Time
4 Nov 2024 23:16:11 EST (-0500)
  Re: how to calculate....  
From: Tor Olav Kristensen
Date: 6 Feb 2003 13:30:04
Message: <web.3e42a93cc6bd118bb417814a0@news.povray.org>
Robert wrote:
>the normal vector based on 3 vectors?
>
>my skills are not very high at the moment but i think it is very simple....
>
>I want to render a plane, that is clipped by a box.
>
>The 3 vectors are:
>
>v1=<12,15,73>
>v2=<28,  4,68>
>v3=<20,10,70>
>

>
>#declare mui_plane=union{
>                                         plane { < ?, ?, ?>, 0
>                                         pigment { color rgb <0.7,0.0,0.0> }
>                                        }
>                                        }
>
> object {
>    mui_plane
>    clipped_by{box{<-1,-1,-1>,<1,1,1>}}
>  }
>
>Is there an easier way or how can I do this?

If those 3 vectors represents the positions
of 3 points on the surface of your plane,
then a normal vector for that plane can be
calculated like this:

#declare vN = vcross(v2 - v1, v3 - v1);

Now the expression for your plane can be
written like this:

plane { vN, 0 translate v1 }

or like this:

plane { vN, vdot(v1, vnormalize(vN)) }

But if v1, v2 and v3 are not positions of 3
points on the surface, then you must give
more information about the problem.
I.e. what these 3 vectors represents.


Tor Olav


Post a reply to this message

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