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 04:29:03 EDT (-0400)
  Re: how to move an object to position <0,0,0>  
From: Nostromo
Date: 8 Sep 2006 07:15:00
Message: <web.450150251e67056d800aa0230@news.povray.org>
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

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