POV-Ray : Newsgroups : povray.newusers : vrotate to point : Re: vrotate to point Server Time
30 Jul 2024 04:17:51 EDT (-0400)
  Re: vrotate to point  
From: Mike Williams
Date: 1 Oct 2004 04:44:52
Message: <f3w7TCAijRXBFw3V@econym.demon.co.uk>
Wasn't it Raf256 who wrote:
>Hi,
>how can I calculate ROTATE so that point <0,1,0> after rotation by 
>vrotate(<0,1,0> , ROTATE) will be equal to some given <XX,YY,ZZ> ?

In general it can't be done. When you rotate the point with vrotate, the
distance from the origin will always be 1. If <XX,YY,ZZ> is at a
different distance from the origin then you can't get there with just a
vrotate().

The Point_At_Trans() macro in transforms.inc will rotate <0,1,0> into
vnormalize(XX,YY,ZZ). If you must have a vrotate(), then you might be
able to reverse engineer that macro to convert it from a matrix
transform to a rotation.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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