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 › YZ plane Fill
Page Index Toggle Pages: 1
YZ plane Fill (Read 419 times)
YZ plane Fill
Mar 28th, 2008, 4:57am
 
Hey all, I'm having a problem getting my program to work right.

I'm trying to use vectors and create a plane on the Y,Z plane.  I have it working on the XY and XZ plane, but the YZ plane won't Fill at all.

Here's the code I'm using

   //RightFace
   beginShape();
     vertex(120,10,-110);
     vertex(120,10,-10);
     vertex(120,110,-10);
     vertex(120,110,-35);
     bezierVertex(120,110,-35, 120,35,-35, 120,35,-110);
     vertex(120,35,-110);
     vertex(120,10,-110);
   endShape();

and here's a link to the current applet
http://au70server.dyn-o-saur.com/BezierBroke/applet/
with the full code at
http://au70server.dyn-o-saur.com/BezierBroke/applet/BezierBroke.pde


I don't understand why it worked three times, but for that third one it won't fill.


Thank you everyone for any time you put into responding, I really appreciate it.
-Paul
Re: YZ plane Fill
Reply #1 - Mar 29th, 2008, 4:53pm
 
try replacing the problematic call to bezierVertex with this manual equivalent (or, at least, i *think* i got all the values in the right place to be equiv :D)

Quote:

     for (int i=0; i<=g.bezierDetail; i++) {
       float t = float(i) / float(g.bezierDetail);
       float x = 120f;
       float y = bezierPoint(110f,110f,35f,35f,t);
       float z = bezierPoint(-35f,-35f,-35f,-110f,t);
       vertex(x,y,z);
     }


it seems there might be a problem wtih bezierVertex, somehow generating geometry that's confusing the triangulator.  if the above code works for you, then you should probably post it as a bug to check into.
Re: YZ plane Fill
Reply #2 - Mar 29th, 2008, 8:48pm
 
Hey, Thanks, that did work Smiley (even though it didn't make that much sense to me. So did you basically go through and define the entire curve with points?)

I also found that I could just repeat one of the working ones, and translate/rotate it into position. (but it's probably less efficient than your solution)

Thanks again for your help, I'll head over now and submit it as a bug.
Page Index Toggle Pages: 1