POV-Ray : Newsgroups : povray.newusers : vrotate to point Server Time
2 Nov 2024 01:21:05 EDT (-0400)
  vrotate to point (Message 1 to 3 of 3)  
From: Raf256
Subject: vrotate to point
Date: 1 Oct 2004 02:23:52
Message: <415cf7f8$1@news.povray.org>
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> ?


Post a reply to this message

From: Tim Nikias
Subject: Re: vrotate to point
Date: 1 Oct 2004 04:39:17
Message: <415d17b5@news.povray.org>
If you take a look at my Download-Section, you'll find "look_at.inc", which
rotate <0,0,-1> to look at a given point. But I think there is also some
macro supplied with POV-Ray, though I don't have a clue how it's named or
where to find it. I'm just the "Do-It-Yourself"-Guy, hence the Include-File.

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Mike Williams
Subject: Re: vrotate to point
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.