POV-Ray : Newsgroups : povray.advanced-users : Point at a vector; angles for rotation on axes X and Y /w nonzero origin : Re: Point at a vector; angles for rotation on axes X and Y /w nonzero origi= Server Time
28 Jul 2024 12:22:16 EDT (-0400)
  Re: Point at a vector; angles for rotation on axes X and Y /w nonzero origi=  
From: Tor Olav Kristensen
Date: 16 Aug 2005 18:25:00
Message: <web.4302672e81614d0952d573c20@news.povray.org>
The same result can be achieved if you add this code after the
"vTo"-calculation:

  #declare vAxis = vnormalize(vcross(vFrom, vTo));
  #declare Angle = acos(vdot(vnormalize(vFrom), vnormalize(vTo)));
  #declare RotationAmount = 1.0; // Try other values here (between 0 to 1)

- and then replace this statement:

  Reorient_Trans(vFrom, vTo)

- with this one:

  Axis_Rotate_Trans(vAxis, degrees(Angle)*RotationAmount)

--
Tor Olav
http://subcube.com


Post a reply to this message

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