|
|
Nicolas Calimet wrote:
>
> > They will be re-parsed (and a duplicate created) unless you make sure that
> > they are not. The way you do this is to either:
> > 1) check the "clock" variable to see if it is the first frame
>
I quote myself:
> Ok, it works fine if I do something like:
>
> #if(clock=0)
> box{ ... label thebox }
> #else
> modify{ thebox ... }
> #end
Well actually even that is not true. A persistent
object will not behave as a similar non-persistent object
after the second frame of animation. Rotating the persistent
object through the modify statement will be wrong, while
translations seem to work properly.
I tried the following code (render with 3 or more
frames):
#version unofficial MegaPOV 0.5;
#declare RATIO = 640/480;
global_settings { ambient_light 0.01 max_trace_level 20 }
camera
{
right x
up y/RATIO
angle 12
location -300*z
look_at <0,0,0>
}
light_source{ -300*z rgb 0.66 shadowless }
light_source{ -300*z rgb 1.00 rotate <45,-25,0> }
background{ rgb 1 }
#declare Red = texture{pigment{rgb<1,0,0>}}
#declare Green = texture{pigment{rgb<0,1,0>}}
#declare Blue = texture{pigment{rgb<0,0,1>}}
// Is it also a persistent variable ?
#declare mbox = mesh
{
triangle{ <-10,10,-10>,<10,10,-10>,<10,10,10> texture{Red} }
triangle{ <-10,10,-10>,<-10,10,10>,<10,10,10> texture{Red} }
triangle{ <-10,-10,-10>,<10,-10,-10>,<10,-10,10> }
triangle{ <-10,-10,-10>,<-10,-10,10>,<10,-10,10> }
triangle{ <-10,-10,-10>,<-10,-10,10>,<-10,10,10> }
triangle{ <-10,-10,-10>,<-10,10,-10>,<-10,10,10> }
triangle{ <10,-10,-10>,<10,-10,10>,<10,10,10> texture{Green} }
triangle{ <10,-10,-10>,<10,10,-10>,<10,10,10> texture{Green} }
triangle{ <-10,-10,-10>,<10,-10,-10>,<-10,10,-10> texture{Blue} }
triangle{ <-10,10,-10>,<10,10,-10>,<10,-10,-10> texture{Blue} }
triangle{ <-10,-10,10>,<10,-10,10>,<-10,10,10> }
triangle{ <-10,10,10>,<10,10,10>,<10,-10,10> }
texture{ pigment{ color rgb 0.9 } }
rotate <45,0,0>
}
// right box
object{ mbox rotate y*60*clock translate 11*x }
// left box (persistent object)
#if(clock=0)
object{ mbox translate -11*x label thebox }
#else
// Move back to the center, rotate, and translate again to its old position
// But what's appening to rotations after the second frame ?
modify{ thebox translate 11*x rotate y*60*clock translate -11*x }
#end
#render concat("\nClock value is ",str(clock,0,3))
*** Nicolas Calimet
*** pov### [at] freefr
Post a reply to this message
|
|