POV-Ray : Newsgroups : povray.newusers : Simple trig question - what I really want to do : Re: Simple trig question - what I really want to do Server Time
28 Jul 2024 22:26:16 EDT (-0400)
  Re: Simple trig question - what I really want to do  
From: Tim Attwood
Date: 13 Jun 2007 17:32:21
Message: <46706265$1@news.povray.org>
You can avoid most of the math by using...

#include "transforms.inc"
#macro ShowGuide(Position,AtX,AtY,AtZ, BeamSize)
union {
   //centre of beam
   cylinder{ <0,0,0>,<0,2,0>, 0.005
      pigment {color Yellow}
   }
   //to define top edge of beam in Y
   cylinder{ <0,0,0>,<0,2,0>,0.005
      pigment {color Red}
      rotate< -BeamSize,0,0>
   }
   //to define bottom edge of beam in Y
   cylinder{ <0,0,0>,<0,2,0>,0.005
      pigment {color Green}
      rotate<  BeamSize,0,0>
   }
   #local p = <Position,1.2,-0.6>;
   #local pa = <AtX,AtY+0.3,AtZ>;
   #local ny = vnormalize(pa-p);// new up vector
   Point_At_Trans(ny)
   translate p
}
#end


Post a reply to this message

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