POV-Ray : Newsgroups : povray.unofficial.patches : Linux MegaPOV 0.5a and persistent object problems Server Time
2 Sep 2024 02:12:32 EDT (-0400)
  Linux MegaPOV 0.5a and persistent object problems (Message 1 to 5 of 5)  
From: Nicolas Calimet
Subject: Linux MegaPOV 0.5a and persistent object problems
Date: 18 Aug 2000 15:31:47
Message: <399D91DB.BEF78CBC@free.fr>
Hi all there !

	I just started to try persistent objects in animations
with MegaPOV 0.5a for Linux. AFAI understand, the purpose of
object with defined labels is not to be destroyed from frame
to frame. But does it mean there are not re-parsed after the
first frame ? It seems they are (while using big objects as
meshes for instance). I would expect the opposite.
	Second, I noticed one weird result while rendering the
last frame of the following simple test-case animation. I would
like to know if I'm missing something critical, or if this beha-
viour is related to a possible bug (maybe Linux-specific ?).
	Thanks for any comment, you're welcome to flame me ;-)


command line -------------------------------------------------

x-megapov megapov.ini +i test.pov +kff3

ini file -----------------------------------------------------

Width = 320
Height = 240
Pause_when_Done = off
Bounding_Threshold = 3
Test_Abort = On
Test_Abort_Count = 100
Persistent_Animation = yes

test file ----------------------------------------------------

#version unofficial MegaPOV 0.5;

#declare RATIO  = 320/240;

global_settings { ambient_light 0.01  max_trace_level 20 }

camera
{
  right    x
  up       y/RATIO
  angle    10
  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 }

box
{
  <-10,-10,-10><10,10,10>
  pigment{ rgb <1,0,0> }
  rotate <45,45,45>
  label thebox
}

#if(clock>0)
modify
{
  thebox 
  pigment{ rgb <1-clock,clock,1-clock> }
  rotate y*70*clock
}
#end



*** Nicolas Calimet
*** pov### [at] freefr


Post a reply to this message

From: Nathan Kopp
Subject: Re: Linux MegaPOV 0.5a and persistent object problems
Date: 18 Aug 2000 18:38:21
Message: <399dbadd@news.povray.org>
"Nicolas Calimet" <pov### [at] freefr> wrote...
> Hi all there !
>
> I just started to try persistent objects in animations
> with MegaPOV 0.5a for Linux. AFAI understand, the purpose of
> object with defined labels is not to be destroyed from frame
> to frame. But does it mean there are not re-parsed after the
> first frame ?

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
2) set a persistent variable at the end of your scene (so it will get set at
the end of the first frame) and then check for it before creating those
objects.

Please be aware that there are a bugs right now with persistent objects  and
with persistent variables.  :-(

-Nathan


Post a reply to this message

From: Mark Gordon
Subject: Re: Linux MegaPOV 0.5a and persistent object problems
Date: 18 Aug 2000 20:10:04
Message: <399DD12D.BC15AD20@mailbag.com>
Nathan Kopp wrote:

> They will be re-parsed (and a duplicate created)

That explains what I'm seeing.  For each frame beyond the second, you
get another box in the image.

-Mark Gordon


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Linux MegaPOV 0.5a and persistent object problems
Date: 19 Aug 2000 06:44:11
Message: <399E67B0.F99ADC16@free.fr>
> 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

	Thanks !
	Ok, it works fine if I do something like:

#if(clock=0)
  box{ ...  label thebox }
#else
  modify{ thebox  ... }
#end

> 2) set a persistent variable at the end of your scene (so it will get set at
> the end of the first frame) and then check for it before creating those
> objects.

   ... but NOT if doing the following:

#ifndef(persist)
  box{ ...  label thebox }
#else
  modify{ thebox  ... }
#end

#declare persist = 1;

	Here the box is never modified (my ini file still contains
Persistent_Animation = yes). Same result if I put the #declare
within the #ifndef condition. Again I may do something wrong...
[I already noticed a strange behaviour of #ifdef/#ifndef tests
in official POV-Ray also]. Any clue ?


*** Nicolas Calimet
*** pov### [at] freefr


Post a reply to this message

From: Nicolas Calimet
Subject: Nathan says there are bugs... I agree ;-)
Date: 19 Aug 2000 09:14:44
Message: <399E8AF9.11B7D4EF@free.fr>
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

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