POV-Ray : Newsgroups : povray.general : The Eternal Student: Loop Problem : Re: The Eternal Student: Loop Problem Server Time
25 Apr 2024 15:41:30 EDT (-0400)
  Re: The Eternal Student: Loop Problem  
From: Sven Littkowski
Date: 29 Jan 2018 03:27:29
Message: <5a6edaf1$1@news.povray.org>
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-2023 Persistence of Vision Raytracer Pty. Ltd.