POV-Ray : Newsgroups : povray.newusers : Coordinates after rotation? : Re: Coordinates after rotation? Server Time
1 Jul 2024 02:45:19 EDT (-0400)
  Re: Coordinates after rotation?  
From: clipka
Date: 29 Jun 2011 22:55:37
Message: <4e0be5a9$1@news.povray.org>
Am 29.06.2011 08:55, schrieb Roman Reiner:
> "zozimus"<nomail@nomail>  wrote:
>> I am having some difficulty connecting a few cylinders which I'm trying to make
>> a 3D pentagram knot with. The problem is that I'm not sure of the coordinates of
>> the ends of the cylinders after I have translated and rotated them.
>>
>> Is there a way of doing:
>>
>> Macro (<A,B,C>,
>> translate<0,20,-10>
>> rotate<20,0,10>  )
>> etc
>>
>> to return the coordinates of<A,B,C>  after the transformations?
>
> Yes!
>
> #declare NewABC = vrotate(<A,B,C>+<0,20,-19>,<20,0,10>)

Or for the generic case:

----------------
#include "transforms.inc"

#declare MyTransform = transform {
   translate <0,20,-10>
   rotate <20,0,10>
   ...
}

#declare NewABC = vtransform(MyTransform);
----------------


Post a reply to this message

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