|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi,
I created a simple object that looks like a Rubics cube (a big cube
consisting of 27 smaller cubes). Then I show this object and want to rotate
it (animation). Unfortunately it doesn't rotate around the middle of the
object (big cube) but one of the corners of the big cube. Because object in
POVray always rotate around the origin it seems, that my object isn't
exactly centerd. But how do I center the object? I tried the function
"Center_Trans" but it didn't work, so it didn't get better. Does anone have
some suggestions what I do wrong or what I can do better?
Thanks in advance.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <web.45012a4161ac9985800aa0230@news.povray.org>,
"Nostromo" <nomail@nomail> wrote:
> Hi,
>
> I created a simple object that looks like a Rubics cube (a big cube
> consisting of 27 smaller cubes). Then I show this object and want to rotate
> it (animation). Unfortunately it doesn't rotate around the middle of the
> object (big cube) but one of the corners of the big cube. Because object in
> POVray always rotate around the origin it seems, that my object isn't
> exactly centerd. But how do I center the object? I tried the function
> "Center_Trans" but it didn't work, so it didn't get better. Does anone have
> some suggestions what I do wrong or what I can do better?
> Thanks in advance.
move your "rubrics cube" by adding "translate -0.50*full_cube_size"
--
klp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
kurtz le pirate <kur### [at] yahoofr> wrote:
> move your "rubrics cube" by adding "translate -0.50*full_cube_size"
This applies if your object rotates _exactly_ around that corner. In any
other case the following should work as long as the object is not too
complicated:
translate -0.50*(min_extent(myObject)+max_extent(myObject))
this actually centers the bounding box of the object but that should be
calculated correctly for a cube-ish structure
Hope this helps
Regards Roman
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Roman Reiner" <lim### [at] gmxde> wrote:
> kurtz le pirate <kur### [at] yahoofr> wrote:
> > move your "rubrics cube" by adding "translate -0.50*full_cube_size"
>
> This applies if your object rotates _exactly_ around that corner. In any
> other case the following should work as long as the object is not too
> complicated:
>
> translate -0.50*(min_extent(myObject)+max_extent(myObject))
>
> this actually centers the bounding box of the object but that should be
> calculated correctly for a cube-ish structure
>
> Hope this helps
> Regards Roman
Thanks for your answer. Unfortunately the cube still doesn't rotate around
the middle, maybe the bounding box of my cube is somewhere odd. Any other
suggestions?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nostromo <nomail@nomail> wrote:
> Thanks for your answer. Unfortunately the cube still doesn't rotate around
> the middle, maybe the bounding box of my cube is somewhere odd. Any other
> suggestions?
Well, do you know the actual limits of the cube? If you do, just
substitute them in the given formula.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
From: Penelope20k
Subject: Re: how to move an object to position <0,0,0>
Date: 8 Sep 2006 06:58:00
Message: <45014cb8@news.povray.org>
|
|
|
| |
| |
|
|
Nostromo do a little mistake its in fact
translate + 0.50*(min_extent(myObject)+max_extent(myObject))
news:web.4501400e1e67056d800aa0230@news.povray.org...
> "Roman Reiner" <lim### [at] gmxde> wrote:
> > kurtz le pirate <kur### [at] yahoofr> wrote:
> > > move your "rubrics cube" by adding "translate -0.50*full_cube_size"
> >
> > This applies if your object rotates _exactly_ around that corner. In any
> > other case the following should work as long as the object is not too
> > complicated:
> >
> > translate -0.50*(min_extent(myObject)+max_extent(myObject))
> >
> > this actually centers the bounding box of the object but that should be
> > calculated correctly for a cube-ish structure
> >
> > Hope this helps
> > Regards Roman
>
> Thanks for your answer. Unfortunately the cube still doesn't rotate around
> the middle, maybe the bounding box of my cube is somewhere odd. Any other
> suggestions?
>
>
Post a reply to this message
|
|
| |
| |
|
|
From: Penelope20k
Subject: Re: how to move an object to position <0,0,0>
Date: 8 Sep 2006 07:00:39
Message: <45014d57@news.povray.org>
|
|
|
| |
| |
|
|
Forget it, its not nostromo mistake ,, should be mine
news:45014cb8@news.povray.org...
> Nostromo do a little mistake its in fact
>
> translate + 0.50*(min_extent(myObject)+max_extent(myObject))
>
>
>
>
>
> news:web.4501400e1e67056d800aa0230@news.povray.org...
> > "Roman Reiner" <lim### [at] gmxde> wrote:
> > > kurtz le pirate <kur### [at] yahoofr> wrote:
> > > > move your "rubrics cube" by adding "translate -0.50*full_cube_size"
> > >
> > > This applies if your object rotates _exactly_ around that corner. In
any
> > > other case the following should work as long as the object is not too
> > > complicated:
> > >
> > > translate -0.50*(min_extent(myObject)+max_extent(myObject))
> > >
> > > this actually centers the bounding box of the object but that should
be
> > > calculated correctly for a cube-ish structure
> > >
> > > Hope this helps
> > > Regards Roman
> >
> > Thanks for your answer. Unfortunately the cube still doesn't rotate
around
> > the middle, maybe the bounding box of my cube is somewhere odd. Any
other
> > suggestions?
> >
> >
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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?
Here's the POV file
-------------------------------------------
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "glass.inc"
#include "metals.inc"
#include "woods.inc"
#include "functions.inc"
#declare Count = 3 ;
#declare Gap = 0.2 ;
global_settings {
ambient_light rgb <1, 1, 1>
}
background { rgb <1,1,1> }
#declare Rubics = union {
#declare z_axis = 0 ;
#while ( z_axis < Count )
#declare y_axis = 0 ;
#while ( y_axis < Count )
#declare x_axis = 0 ;
#while (x_axis < Count)
superellipsoid { <0.25, 0.25>
translate <(2+Gap)*x_axis, (2+Gap)*y_axis, (2+Gap)*z_axis>
}
#declare x_axis = x_axis + 1 ;
#end
#declare y_axis = y_axis + 1 ;
#end
#declare z_axis = z_axis + 1 ;
#end
}
camera {
location <25, 20, -25>
look_at <8, 6, 0>
}
light_source {
<200, 200, -200>
color rgb <1,1,1>
}
object { Rubics
pigment { color Green } //Col_Glass_Vicksbottle }
finish {
phong 1
reflection 0.15
ambient 0.2
diffuse 0.9
}
interior { I_Glass }
scale <3,3,3>
rotate <clock, clock*2, clock*4>
translate +0.50*(min_extent(Rubics)+max_extent(Rubics))
}
-----------------------------------------------
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.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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?
>
> Here's the POV file
>
[snip]
> object { Rubics
> pigment { color Green } //Col_Glass_Vicksbottle }
> finish {
> phong 1
> reflection 0.15
> ambient 0.2
> diffuse 0.9
> }
> interior { I_Glass }
> scale <3,3,3>
> rotate <clock, clock*2, clock*4>
> translate +0.50*(min_extent(Rubics)+max_extent(Rubics))
> }
>
> -----------------------------------------------
>
> 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.
Nostromo
You should translate to the origin before rotating
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |