POV-Ray : Newsgroups : povray.newusers : Coordinates after rotation? Server Time
28 Jun 2024 22:58:44 EDT (-0400)
  Coordinates after rotation? (Message 1 to 5 of 5)  
From: zozimus
Subject: Coordinates after rotation?
Date: 28 Jun 2011 15:20:01
Message: <web.4e0a29031deb8c0ebe377b680@news.povray.org>
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? I've tried to
figure out how to use vtransform but it is confusing!

Thanks in advance!!


Post a reply to this message

From: Jim Holsenback
Subject: Re: Coordinates after rotation?
Date: 28 Jun 2011 16:01:21
Message: <4e0a3311$1@news.povray.org>
On 06/28/2011 04:18 PM, zozimus 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? I've tried to
> figure out how to use vtransform but it is confusing!
>
> Thanks in advance!!
>
>
maybe vaxis_rotate is what you want ... it's in 3.2.1.4.5 Functions of 
the reference basically it returns a vector thats equal to some point in 
space after you've rotated it ... this example will tell you where the 
1st parameter (a vector) is after you've rotated it in the z direction 
by 315 degrees ... the 2nd and 3rd parameters respectively.

#declare SomePoint = vaxis_rotate (<-0.295,4.29,0>, <0,0,1>, 315);

Good Luck


Post a reply to this message

From: Roman Reiner
Subject: Re: Coordinates after rotation?
Date: 29 Jun 2011 03:00:01
Message: <web.4e0acc6ba88fb21c6e991f980@news.povray.org>
"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>)

Regards Roman


Post a reply to this message

From: clipka
Subject: Re: Coordinates after rotation?
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

From: clipka
Subject: Re: Coordinates after rotation?
Date: 29 Jun 2011 23:06:15
Message: <4e0be827$1@news.povray.org>
Am 30.06.2011 04:55, schrieb clipka:
> #declare NewABC = vtransform(MyTransform);

Sorry, should be

   #declare NewABC = vtransform(<A,B,C>,MyTransform);


Post a reply to this message

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