POV-Ray : Newsgroups : povray.general : Rotating an object : Re: Rotating an object Server Time
31 Jul 2024 06:17:26 EDT (-0400)
  Re: Rotating an object  
From: Ger
Date: 5 Oct 2007 22:35:04
Message: <4706f458@news.povray.org>
John VanSickle wrote:

> 
> You really don't need to do this arcsin and rotation stuff.
> 
> The better way to do it is:
> 
> #local vZ=vnormalize(Position2-Position1);
> #local vX=vnormalize(vcross(y,vZ));
> 
> and replace the rotate and translate with this:
> 
> matrix < vX.x,        vX.y,        vX.z,
>           0,           1,           0,
>           vZ.x,        vZ.y,        vZ.z,
>           Position1.x, Position1.y, Position1.z>
> 
> It may help you with this to also read
> 
>    http://www.geocities.com/evilsnack/matrix.htm ,
> 
> which is tutorial I wrote about the matrix transform.
> 
> Regards,
> John

I had it figured out with a lot of #if's in it, but I tried your solution
anyway because it looks so much more elegant. 
But now a wall is rotated y * 90 from where it is supposed to be.

-- 
Ger


Post a reply to this message

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