POV-Ray : Newsgroups : povray.newusers : rotate to given point Server Time
4 Nov 2024 19:16:55 EST (-0500)
  rotate to given point (Message 1 to 4 of 4)  
From: Rafal 'Raf256' Maj
Subject: rotate to given point
Date: 20 Nov 2004 00:13:42
Message: <Xns95A73FAD838E6raf256com@203.29.75.35>
Hi,
I have a point placed on sphere {0 100} - in <0,0,-100>

How to rotate it by:  rotate <RX,RY,0>  so that point will be placed in 
coordinates <X,Y,Z> ?  Point <X,Y,Z> is also on sphere {0 100}


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Slime
Subject: Re: rotate to given point
Date: 20 Nov 2004 02:05:14
Message: <419eecaa@news.povray.org>
> How to rotate it by:  rotate <RX,RY,0>  so that point will be placed in
> coordinates <X,Y,Z> ?  Point <X,Y,Z> is also on sphere {0 100}


Use Reorient_Trans along with vtransform in transforms.inc.

#include "transforms.inc"

#declare reorient = Reorient_Trans(-z, <X,Y,Z>)
#declare point = vtransform(<0,0,-100>, reorient);

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Eero Ahonen
Subject: Re: rotate to given point
Date: 20 Nov 2004 04:13:53
Message: <419f0ad1$1@news.povray.org>
Rafal 'Raf256' Maj wrote:
> Hi,
> I have a point placed on sphere {0 100} - in <0,0,-100>
> 
> How to rotate it by:  rotate <RX,RY,0>  so that point will be placed in 
> coordinates <X,Y,Z> ?  Point <X,Y,Z> is also on sphere {0 100}
> 
> 

One easy possibility is to create the object around origo (<0,0,0>), 
then rotate (and possibly scale) it, then translate it to the final 
destination.

-- 
-Aero


Post a reply to this message

From: Jim Charter
Subject: Re: rotate to given point
Date: 20 Nov 2004 09:28:53
Message: <419f54a5$1@news.povray.org>
Slime wrote:
>>How to rotate it by:  rotate <RX,RY,0>  so that point will be placed in
>>coordinates <X,Y,Z> ?  Point <X,Y,Z> is also on sphere {0 100}
> 
> 
> 
> Use Reorient_Trans along with vtransform in transforms.inc.
> 
> #include "transforms.inc"
> 
> #declare reorient = Reorient_Trans(-z, <X,Y,Z>)
> #declare point = vtransform(<0,0,-100>, reorient);
> 
>  - Slime
>  [ http://www.slimeland.com/ ]
> 
> 
Cool  I never thought of that.  Beautiful.
Instead I rewrote the Reorient_Trans macro to use
vector functions.  But your way is better.


Post a reply to this message

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