FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   Moving along 3d bezier
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Moving along 3d bezier  (Read 365 times)
Captain_Lobotomy

Email
Moving along 3d bezier
« on: Sep 9th, 2003, 10:53pm »

Hi,
 
is there a simple way of retrieving the coordinates of any point on a 3d bezier curve defined by two points and two control points?
 
Seeya,
 
Captlobo
 
Captain_Lobotomy

Email
Re: Moving along 3d bezier
« Reply #1 on: Sep 10th, 2003, 6:42pm »

Oops, just found out this functionality is actually build in.
 
Nevr mind...
 
Jerronimo

WWW
Re: Moving along 3d bezier
« Reply #2 on: Sep 10th, 2003, 9:14pm »

how is this done?
 
Captain_Lobotomy

Email
Re: Moving along 3d bezier
« Reply #3 on: Sep 10th, 2003, 9:59pm »

Well assume you defined a simple 3d Bezier as follows:
 
beginShape(LINE_STRIP);  
bezierVertex(x1, y1, z1); //first point
bezierVertex(x2, y2, z2); //first control handle
bezierVertex(x3, y3, z3); //second control handle
bezierVertex(x4, y4,z4); //second point
endShape();  
 
Then you can access any point(x,y,z) on the curve with:
 
x=bezier(x1,x2,x3,x4,t); //t=0..1
x=bezier(y1,y2,y3,y4,t);
x=bezier(z1,z2,z3,z4,t);  
 
t=0 gives you the starting point, t=1 the endpoint, ..
 
I used this in my first ever applet:
 
http://users.skynet.be/frederikenhermine/
 
Seeya,
 
FVH
 
pollux

WWW Email
Re: Moving along 3d bezier
« Reply #4 on: Sep 10th, 2003, 11:49pm »

beautiful applet, i love the pace. it seems like a parallel universe...
 

pollux | www.frwrd.net
Jerronimo

WWW
Re: Moving along 3d bezier
« Reply #5 on: Sep 11th, 2003, 4:57am »

neat.  i didn't know about that.
 
the documentation has the 't' option in there (time?) but doesn't explain it.  where did you learn about that use of bezier()?
 
benelek

35160983516098 WWW Email
Re: Moving along 3d bezier
« Reply #6 on: Sep 11th, 2003, 9:49am »

hiya, i've made a small explanative sketch of how the time-based bezier works:
 
http://proce55ing.net/discourse/yabb/board_Contribution_Info_ac_tion_display_num_1063266430.html
 
Pages: 1 

« Previous topic | Next topic »