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 & HelpOther Libraries › proGL lights and colors
Page Index Toggle Pages: 1
proGL lights and colors (Read 982 times)
proGL lights and colors
Aug 22nd, 2006, 1:19pm
 
How do I add lights to the shapeObject? When I do it like this:
Code:

myShape.beginRecord();
lights();
.
.
.
myShape.endRecord();

then all colors are gone and I have grey objects.
Another problem is to use this:
Code:

myShape.beginRecord();
beginShape(TRIANGLE_FAN);

fill(f.colors[i]);
vertex(p1[0]*rad2,p1[1]*rad2,p1[2]*rad2);

fill(255,1);
vertex(p2[0]*rad1,p2[1]*rad1,p2[2]*rad1);
vertex(p3[0]*rad1,p3[1]*rad1,p3[2]*rad1);
vertex(p4[0]*rad1,p4[1]*rad1,p4[2]*rad1);
vertex(p5[0]*rad1,p5[1]*rad1,p5[2]*rad1);
vertex(p2[0]*rad1,p2[1]*rad1,p2[2]*rad1);

endShape();
myShape.endRecord();

the first fill seems to not have any effect.
Page Index Toggle Pages: 1