POV-Ray : Newsgroups : povray.general : The Eternal Student: Loop Problem : Re: The Eternal Student: Loop Problem Server Time: 22 Jul 2019 22:21:49 GMT
  Re: The Eternal Student: Loop Problem  
From: Sven Littkowski
Date: 29 Jan 2018 08:27:29
I am doing that now: I declared an initial position, and inside the loop
move that position forward at a fixed amount. Aim is to create something
like a chain-alike structure. However, I still have the same problem:
only one item is visible. I don't even see any more items in different
angles, not even at the same position.


#declare MyRandom = seed (27053);
#local MyLength   = int(20*rand(MyRandom));   // Anzahl der Glieder
#local MyX        = rand(MyRandom)*45;
#local MyY        = rand(MyRandom)*1;
#local MyZ        = rand(MyRandom)*10;
#local MyPosition = 0.00;
#local MyElement  = 0;

#while (MyElement<MyLength)
 object { Element translate < 0.0, 0.0, MyPosition > rotate < MyX, MyY,
MyZ > }
 #declare MyRandom = seed (27053);
 #local MyX        = rand(MyRandom)*45;
 #local MyY        = rand(MyRandom)*1;
 #local MyZ        = rand(MyRandom)*10;
 #local MyPosition = MyPosition+0.45;
 #local MyElement  = MyElement+1;
#end


Post a reply to this message

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