POV-Ray : Newsgroups : povray.newusers : Coupla "newb" questions... : Coupla "newb" questions... Server Time
29 Jul 2024 12:29:07 EDT (-0400)
  Coupla "newb" questions...  
From: Amazon Warrior
Date: 8 Jan 2006 19:15:16
Message: <43c1ab14@news.povray.org>
Heyas!

Just wondering if you can help.  I'm a relative newbie to POV, and  I've
been trying to follow the help file included to solve this, but to no avail.
Basically, I want to create a nested while loop containing two different
instructions- scale and translate- and apply it to a blob object.  The help
file suggests that I put the starting loop instructions just after the
threshold statement of the blob object, like so:

blob {
 threshold 0.5
 #declare Length = 0;
 #while ( Length >= -30 )
  #declare Scale = 2;
  #while ( Scale >= 0.25 )
   sphere { <0,0,0>, 20, 1 scale <1,1,0.9> }
   translate <Length,0,0>
   scale Scale
  #declare Length = Length - 0.25;
  #declare Scale = Scale - 0.1;
 #end
 #end
}

However, when I run this, I get an error message:  No matching } in blob,
sphere found instead.  (I'm using version 3.6, if that makes any
difference.)  I've tried putting the loops in assorted other places as well,
but... nada.

I've also noticed that the help file indicates that the format of nested
while loops should be:

#declare Variable1 = 0;
 #while ( Variable1 <= X )
  #declare Variable2 = 0;
  #while ( Variable2 >= Y )
   {{{Stuff here}}}
  #declare Variable1 = Variable1 + A;
  #end
  #declare Variable2 = Variable2 - B;
#end

I've not found this works.  Instead, I put both #end statements after the
last variable (as in the previous example), and it seems to work, which is
confusing.  I'd be really grateful if someone could tell me what I'm doing
wrong.

Also, can someone fully explain trace for me?  I can't seem to get it to
work properly, and I would like to be able to 'trace' an object repeatedly,
so that several instances of the same object are applied.  Don't know if I'm
making much sense here?

Anyway, cheers for reading this far, and thanks in advance for any replies!

Heulwen.


Post a reply to this message

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