POV-Ray : Newsgroups : povray.general : Rotating an object : Re: Rotating an object Server Time
31 Jul 2024 06:12:21 EDT (-0400)
  Re: Rotating an object  
From: Ger
Date: 5 Oct 2007 01:27:55
Message: <4705cb5a@news.povray.org>
Tim Attwood wrote:

>> The walls are created just fine and placed at the correct place
>> (Position1)
>> but the rotation (rotate Angle) is wrong.
> 
> rotate moves an object around the origin,
> 
> from your code
> OutSideWall(< 200,0,1200>, true,< 200,0,800>, true)
> I deduce that you have a wall starting at <200,0,1200>
> (Position1) and going to <200,0,800> (Position2)
> 
> So if you wish to rotate the wall around Position1 you'd
> first translate the wall to the origin, then rotate it, then
> put it back at Position1.
> 
> object {
>      ThisWall
>      translate -Position1
>      rotate y * Angle
>      translate Position1
> }

The wall is created at the origin, then rotated and then translated.
Everything works okay except for the rotation angle.
-- 
Ger


Post a reply to this message

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