POV-Ray : Newsgroups : povray.newusers : how to move an object to position <0,0,0> : Re: how to move an object to position <0,0,0> Server Time
29 Jul 2024 10:28:10 EDT (-0400)
  Re: how to move an object to position <0,0,0>  
From: kurtz le pirate
Date: 8 Sep 2006 09:27:48
Message: <kurtzlepirate-669711.15274708092006@news.povray.org>
In article <web.450150251e67056d800aa0230@news.povray.org>,
 "Nostromo" <nomail@nomail> wrote:

> Thanks for your help, but it still won't rotate around the middle of thebig
> cube. Maybe someone can have a look at my code and tell me what's wrong?
> 
> ...
> 
> When I animate this I want the cube to rotate around it's center, but it's
> rotating around some point near one of the corners.
> 
> Thanks a lot in advance.


well, well... 

from your source whe can find that :

RMax = max_extent(Rubics) => <5.4, 5.4, 5.4>
RMin = min_extent(Rubics) => <-1, -1, -1>

translate the object with : translate -0.5*(RMax+RMin) give :

RMax = <3.2, 3.2, 3.2>
RMin = <-3.2, -3.2, -3.2>

Rubics is now perfectly center at the origin and rotations are ok. if 
not, there are somes others problems :
 - your are not looking at the origin.
 - in "rotation <clock, clock*2, clock*4>" don't forget that clock varie 
from 0 to 1 degrees


  
-- 
klp


Post a reply to this message

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