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 & HelpSyntax Questions › animating curveVertex in 3D ... #2
Page Index Toggle Pages: 1
animating curveVertex in 3D ... #2 (Read 399 times)
animating curveVertex in 3D ... #2
Feb 9th, 2006, 10:35am
 
Hi, and sorry that I did not formulate the idea properly.

I wonder if there is an easy way of 'filling in' the space between two polygon shapes, so that they become a solid shape rather than two surfaces?

... or do I have to work with triangles that combine the two corresponding vertex points in a sandwitch of vertex shapes? (that will end up being an awful lot of triangle arrays:(

Here's and example that demonstrates the problem:

import processing.opengl.*;

void setup(){
  size(500, 500, OPENGL);
  background(0);
  fill(20, 150, 200);
  noStroke();
  lights();
  //smooth();
 
  pushMatrix();
  translate(250, 200, 200);
  beginShape(POLYGON);
     curveVertex(10, 10, 10); // I would like to fill the space from this point ...
     curveVertex(20, 30, 10);
     curveVertex(50, 40, 10);
     curveVertex(70, 30, 10);
     curveVertex(25, 10, 10);
     curveVertex(16, 5, 10);
  endShape();
  popMatrix();
 
  fill(20, 100, 10);
  pushMatrix();
  translate(250, 200, 150);
  beginShape(POLYGON);
     curveVertex(15, 15, 10); //... with this point aso.
     curveVertex(25, 35, 10);
     curveVertex(55, 45, 10);
     curveVertex(75, 35, 10);
     curveVertex(30, 15, 10);
     curveVertex(121, 10, 10);
  endShape();
  popMatrix();
}
Re: animating curveVertex in 3D ... #2
Reply #1 - Feb 9th, 2006, 5:26pm
 
annemarie

I'm not sure I fully understand your question.
Do you want to take 2 planes and create a "skin" around them, the same way a cylinder is a skin of a sort around to separated parallel circles? Here's some code I wrote a while back that does just that. http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Contribution_3DOpenGL;action=display;num=1132621234

The cylinder is easy since it's symmetrical. Any other shape, you'd want to collect edge points in an array and then patch em using QUAD_STRIP or TRIANGLE_STRIP.

I'd also suggest centering the entire object on the origin and translating once.

ira
Page Index Toggle Pages: 1