| 
  | 
Hi,  I am starting to study povray at university and I am playing around
with a simple animation.  What I want is a cube made up of 6 polygon
objects with verious textures applied to each.  The cube is centered around
0,0,0 and all I want to do is rotate the cube around an axis from the top
left back corner to the bottom right front corner i.e. the cube rotates
diagnaly round ( excuse the spelling).  I have generated the following code
but cannot get my head around the rotation.  Is it possible the define a
new axis other than x y z and rotate the object around it?
//First animation
#include "colors.inc"
#include "textures.inc"
global_settings {
  assumed_gamma 1.0
}
camera {
       location <0, 0, -8 >
       look_at <0, 0, 0>
}
light_source {
      <0, 2, -8> White
}
plane { y, -6
      texture {
       pigment { checker color White color Green }
       }
}
sphere {
        <0, 0, 0> 1
        pigment { White}
}
union {
polygon { // side left
 5,
 <-1, -1, 1>,
 <-1, 1, 1>,
 <-1, 1, -1>,
 <-1, -1, -1>,
 <-1, -1, 1>
 texture {
  pigment {
   image_map { gif "yoda3.gif"}
   rotate y*90
  }
 }
}
polygon { // side right
 5,
 <1, -1, 1>,
 <1, 1, 1>,
 <1, 1, -1>,
 <1, -1, -1>,
 <1, -1, 1>
 texture {Jade }
}
polygon { // side front
 5,
 <-1, -1, -1>,
 <-1, 1, -1>,
 <1, 1, -1>,
 <1, -1, -1>,
 <-1, -1, -1>
 texture {
  pigment {
   image_map { gif "yoda3.gif"}
  }
 }
}
polygon { // side back
 5,
 <-1, -1, 1>,
 <-1, 1, 1>,
 <1, 1, 1>,
 <1, -1, 1>,
 <-1, -1, 1>
 pigment{ rgbf <1,0,1,0.75>  }
}
polygon { // top
 5,
 <-1, 1, -1>,
 <1, 1, -1>,
 <1, 1, 1>,
 <-1, 1, 1>,
 <-1, 1, -1>
 texture {
 pigment { Blue }
 normal {dents 1.5 scale 0.2}
 finish { phong 1}
 }
}
polygon { // bottom
 5,
 <-1, -1, -1>,
 <1, -1, -1>,
 <1, -1, 1>,
 <-1, -1, 1>,
 <-1, -1, -1>
 pigment {
 gradient x
 color_map {
    [0.5 color Red]
    [0.3 color Yellow]
    [0.5 color Blue]
    }
        }
}
 //rotate y*clock*10
 //rotate z*clock*5
        //rotate x*clock*5
}
Hope you can understand what Im asking and help
Cheers
 Post a reply to this message 
 | 
  |