POV-Ray : Newsgroups : povray.newusers : rotate object around its center : Re: rotate object around its center Server Time
28 Jul 2024 16:20:04 EDT (-0400)
  Re: rotate object around its center  
From: Alain
Date: 19 May 2008 15:13:40
Message: <4831d164$1@news.povray.org>
Chrisir nous illumina en ce 2008-05-19 12:51 -->
> 
> Hello!
> 
> How can I rotate an object around its center?
> 
> I currently use
> 
> Rotate_Around_Trans( < 0, 90 , 0 >, < x1, 0.4, y1 > )
> 
> with
> 
> #include "transforms.inc"
> 
> but I don't think it's working.
> 
> Does the expression
> < 0, 90 , 0 >
> mean rotate around y for 90 degrees (and leave x and z as is)?
> 
> Because that's what I want to do.
> 
> Please tell me whete my current code is wrong or
> how to do it.
> 
> Thanks!
> 
> Greetings,
> 
> Chris
> 
> 
> 
> 
Acording to the documentation, you are correct.
That macro operate by translating the object by -1*< x1, 0.4, y1 >, rotate it by 
the amount wanted, then translate it back to it's original location.
If the point provided is outside the object, then the object will orbit that point.

As Jim mentioned, it's usualy way easier to create all your objects around the 
origin, apply any desired scaling and rotation, then to translate them to the 
desired location.

Depending on the orientation of the camera and the location of your object(s), 
it's possible that the applied rotation don't look like what you expect, even if 
it did exactly what it should.

-- 
Alain
-------------------------------------------------
I hope our wisdom will grow with our power, and teach us, that the less we
use our power the greater it will be.
Thomas Jefferson


Post a reply to this message

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