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 & HelpPrograms › drawing a moon
Page Index Toggle Pages: 1
drawing a moon (Read 608 times)
drawing a moon
Dec 18th, 2005, 12:25pm
 
Hi guys,

I'm trying to draw a moon in 3D. I have to back and the front of the moon drawn, but need to add the sides, to make it look 3D. Any ideas , here is my code so far ?

void moon() {
pushMatrix();

//front side of moon
pushMatrix();
      beginShape(POLYGON);
      //first anchor point
      vertex(35, 20);
      //(30,75) is second anchor point
      bezierVertex(80, 0, 80, 75, 30, 75);
      bezierVertex(40,75, 60, 25, 35, 20);
      endShape();
popMatrix();


//back side of moon
pushMatrix();
translate(0,0,-6);
      beginShape(POLYGON);
      vertex(35, 20);
      bezierVertex(80, 0, 80, 75, 30, 75);
      bezierVertex(40,75, 60, 25, 35, 20);
      endShape();
popMatrix();




popMatrix();
}
Re: drawing a moon
Reply #1 - Dec 22nd, 2005, 5:31pm
 
A moon would be a sphere with an intense light one it from one side?!
Page Index Toggle Pages: 1