POV-Ray : Newsgroups : povray.newusers : how to move an object to position <0,0,0> Server Time
29 Jul 2024 08:10:51 EDT (-0400)
  how to move an object to position <0,0,0> (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: kurtz le pirate
Subject: Re: how to move an object to position <0,0,0>
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

From: Roman Reiner
Subject: Re: how to move an object to position <0,0,0>
Date: 8 Sep 2006 13:00:00
Message: <web.4501a0e91e67056d3e732b9a0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> kurtz le pirate <kur### [at] yahoofr> wrote:
> > move your "rubrics cube" by adding "translate -0.50*full_cube_size"
>
>   Just curious: What's the second 0 for?
>
> --
>                                                           - Warp

when writing my own code i'd actually leave the first 0 out as well. i just
wanted to clean it up a little and went over the top maybe ;)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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