![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
kurtz le pirate <kur### [at] yahoo fr> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
kurtz le pirate <kur### [at] yahoo fr> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Roman Reiner" <lim### [at] gmx de> wrote:
> kurtz le pirate <kur### [at] yahoo fr> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] gmx de> wrote:
> > kurtz le pirate <kur### [at] yahoo fr> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] gmx de> wrote:
> > > kurtz le pirate <kur### [at] yahoo fr> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> wrote:
> kurtz le pirate <kur### [at] yahoo fr> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |