POV-Ray : Newsgroups : povray.newusers : Retrieving point information after rotation : Re: Retrieving point information after rotation Server Time
2 Jul 2024 21:48:17 EDT (-0400)
  Re: Retrieving point information after rotation  
From: clipka
Date: 3 Feb 2011 14:33:51
Message: <4d4b031f$1@news.povray.org>
Am 29.01.2011 19:55, schrieb Charles C:
> Stephen's answer is probably what you want.   But if you really want to know the
> x,y,z location, you can create a vector representing the axis of your cylinder
> before rotation and then rotate the vector by the same amount.
>
>  From the manual:
>
> "vaxis_rotate(A,B,F) Rotate A about B by F. Given the x,y,z coordinates of a
> point in space designated by the vector A, rotate that point about an arbitrary
> axis defined by the vector B. Rotate it through an angle specified in degrees by
> the float value F. The result is a vector containing the new x,y,z coordinates
> of the point."


Or, more generally, instead of

   cylinder {
     A, B, R
     rotate <...>
     translate <...>
     scale <...>
   }

you could use:

   #local MyTransform = transform {
     rotate <...>
     translate <...>
     scale <...>
   }
   cylinder {
     A, B, R
     transform { MyTransform }
   }

then you can get the final position of A and B by evaluating:

   #local A2 = vtransform(A, MyTransform);
   #local B2 = vtransform(B, MyTransform);


Post a reply to this message

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