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 › How to draw a 3D Bčzier (HELP)
Page Index Toggle Pages: 1
How to draw a 3D Bčzier (HELP) (Read 422 times)
How to draw a 3D Bčzier (HELP)
Apr 29th, 2007, 7:44pm
 
Hello.
It's not much I'm using Processing and OpenGL.
For my class project I need to draw some interactive splines flowing in 3D space.
... so I have a few questions Smiley

(0) Can 'Processing' handle such a kind of project (3D and smooth lines)
(1) How do I draw a curved line (bezier) in 3D
(2) How can I create a 3D stroke
(3) How can I make the stroke "flow" along its curved path

I'm not expecting someone will solve all my problems for me, I just need some hints on what could be better... just know these topics will be my major discussions on the next few weeks Cheesy


THANKS
Re: How to draw a 3D Bčzier (HELP)
Reply #1 - Apr 29th, 2007, 9:45pm
 
You could extend the example for bezierPoint(), something along these lines:
Code:

stroke(0);
noFill();
beginShape();
int steps = 10;
for (int i = 0; i <= steps; i++) {
float t = (float)(i) / (float)(steps);
float x = bezierPoint(-80, 40, -40, 80, t);
float y = bezierPoint(-70, -50, 90, 70, t);
float z = bezierPoint(-60, -50, 90, 60, t);
vertex(x, y, z);
}
endShape();

Page Index Toggle Pages: 1