POV-Ray : Newsgroups : povray.general : Koordinates Baking part2 : Re: Koordinates Baking part2 Server Time
31 Jul 2024 00:34:24 EDT (-0400)
  Re: Koordinates Baking part2  
From: Tim Attwood
Date: 5 Mar 2008 16:01:33
Message: <47cf0a2d$1@news.povray.org>
> Now I have the problem, that an object will be translated and rotated and 
> this
> couple of times:
>
> 1.: I rotate an object around <0,0,0>
> 2.: Then I translate it to <1,0,0>
> 3.: Now I'm rotating it again (again around <0,0,0>)
>
> If I use vrotate, I need to give at step 3 the new position of my vector:
> #declare MyVector_Rotation=vrotate(MyVector_Position,<10,20,30>) for 
> example
>
> but where is my first rotation, assigned at step 1?
>
> How to give the vrotate my Position AND my (older) orientation?
>
> Maybe, I have some confusing how to use the rotation vector, after using
> vrotate?
>
> After calkulating the vectors, I would give the objects the following
> coordinates like this:
>
> rotate MyVector_Rotation
> translate MyVector_Position
>
> Is that right?

To rotate around some arbitrary center point instead of <0,0,0>
just translate your point by the assumed center, rotate, then
move it back.

#local Point = <0.5,0.5,0>; // some point
#local CenterPoint = <1,2,3>; // center to rotate around
#local Rotation = <10,20,30>; // rotation angles
#local ResultPoint =  vrotate(Point-CenterPoint,Rotation)+CenterPoint;


Post a reply to this message

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