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 › multible texture() within one beginShape()
Page Index Toggle Pages: 1
multible texture() within one beginShape() (Read 583 times)
multible texture() within one beginShape()
Aug 11th, 2006, 1:31pm
 
Hello Forum,
is it possible to have multiple texture() Calls
within one beginShape()/endShape().
I Got it like this now:

       beginShape(QUADS);
       scale(50);
       texture(a[0]);
       vertex(-4,  4, 4,0,0);
       vertex( 4,  4, 4,800,0);
       vertex( 4, -4, 4,800,800);
       vertex(-4, -4, 4,0,800);
       
       texture(a[1]);
       vertex( 4,  4,  4, 0, 0);
       vertex( 4,  4, -4, 800, 0);
       vertex( 4, -4, -4, 800, 800);
       vertex( 4, -4, 4, 0, 800);
       
       texture(a[2]);
       vertex( 4,  4, -4, 0, 0);
       vertex(-4,  4, -4, 800, 0);
       vertex(-4, -4, -4, 800, 800);
       vertex( 4, -4, -4, 0, 800);
       
       texture(a[3]);
       vertex(-4,  4, -4, 0, 0);
       vertex(-4,  4,  4, 800, 0);
       vertex(-4, -4,  4, 800, 800);
       vertex(-4, -4, -4, 0, 800);
       
       texture(a[4]);
       vertex(-4,  4, -4, 0, 0);
       vertex( 4,  4, -4, 800, 0);
       vertex( 4,  4,  4, 800, 800);
       vertex(-4,  4,  4, 0, 800);
       
       texture(a[5]);
       vertex(-4, -4, -4, 0, 0);
       vertex( 4, -4, -4, 800, 0);
       vertex( 4, -4,  4, 800, 800);
       vertex(-4, -4,  4, 0, 800);
       endShape();

it shows a[5] for each side of the cube and it should not do so.
Does anyone have a clue ?
Thanks in advance
Re: multible texture() within one beginShape()
Reply #1 - Aug 11th, 2006, 6:22pm
 
only one texture can be assigned per beginShape(). just put those inside their or beginShape() calls.
Re: multible texture() within one beginShape()
Reply #2 - Aug 11th, 2006, 7:35pm
 
is it possible to assign a different texture to to each side of the cube (RGB-Cube from Examples, with textures instead of fill).
this code wasnt doing the right thing

beginShape(QUADS);
  scale(50);
  texture(a[0]);
  vertex(-4,  4, 4,0,0);
  vertex( 4,  4, 4,800,0);
  vertex( 4, -4, 4,800,800);
  vertex(-4, -4, 4,0,800);
endShape();
 
beginShape(QUADS);
  texture(a[1]);
  vertex( 4,  4,  4, 0, 0);
  vertex( 4,  4, -4, 800, 0);
  vertex( 4, -4, -4, 800, 800);
  vertex( 4, -4, 4, 0, 800);
   endShape();

my english is not so good, maybe i didnt get you right

BR Stefan
Page Index Toggle Pages: 1