We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › frame my sketch right translate confuses me maybe
Page Index Toggle Pages: 1
frame my sketch right? translate confuses me maybe (Read 667 times)
frame my sketch right? translate confuses me maybe
Oct 15th, 2009, 8:35am
 
i think i get why it's doing this, the sin thing is around 0, but i can't figure out how to push this thing over and back so i can see it all. any tips?









float a=0;

void setup(){
 size(600,600,P3D);
 background(0);

}
void draw() {
  background(random(60),50,0);
 

for(int i=0;i<100;i++) {
 translate(1200,0,-1200);
 noStroke();
 fill(255,100,100,100);
 sphereDetail(10,10);
 sphere(100);
 translate(sin(i*10),50,-500);
 rotateY(a);
a+=0.00001;
 
}
translate(300,-900,-300);

}








thanks!
Re: frame my sketch right? translate confuses me maybe
Reply #1 - Oct 15th, 2009, 1:09pm
 
remember that there is a push / pop built into draw(); ... so your translations that occur at the end of the loop (after sphere rendering) won't do anything because the matrix pops back immediately after...and the translation you have at the start of your for() loop will be cumulative (and huge!) because there's no push/pop in that loop.
Page Index Toggle Pages: 1