Random image generation question?
in
Programming Questions
•
1 year ago
Hi quick one hopefully.
Basically i am trying to write a loop which takes the value between 0 and 100 of a slider and draws an image that number of times in random positions between defined values.
SOoooo.
sliderValue = 50;
void draw(){
people();
}
void people(){
beginShape();
rotateY(radians(90));
scale(1.1,1.1,1.1);
for(int i=(sliderValue);i<100;i++) {
translate(random(-2,-5),0.4,random(1,10));
texture(lad);
vertex(-1, -1, 1, 0, 0);
vertex( 1, -1, 1, 1, 0);
vertex( 1, 1, 1, 1, 1);
vertex(-1, 1, 1, 0, 1);
endShape();
}
Something like that? Although at the moment that just constantly draws the image in random positions without the slider having any impact.....
Hope you can help!
Thanks.
1