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)
   curveVertex() + soft circle
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: curveVertex() + soft circle  (Read 360 times)
Ethan

thanton3 WWW
curveVertex() + soft circle
« on: Jul 30th, 2004, 2:09am »

My first question is about curveVertex().
This code is just started, so it's probably messy and inefficient.  
 
http://www.echocolor.com/domains/echocolor/misc/blob/applet/
 
I'm using curveVertex statements inside a for loop. Is that ok? I know on the documentation it says you have to follow beginShape() with a curveVertex().
 
It almost works. I put the point()'s there so I could see all the points the curves are supposed to go through, but it always misses two. No matter what I change the points_per_blob var to.
 
Can you see where I've gone wrong?
 
The second part of my question is that I want to make this blob soft. So that if it bumps up against another blob they should both deform to fit each other. I think bit-101 did something similar in flash, but I can't find it now.
 
Do you have any suggestions for how to approach something like that? Where should I start. If I can fix this code, then I just need to figure out how to move my points...
 
Thanks a lot.
 
skloopy

WWW
Re: curveVertex() + soft circle
« Reply #1 on: Jul 30th, 2004, 7:06am »

Oh i ran into the same problem a while ago. It's actually not a problem, just the way that catmull-rom splines work. The end three vertices have to overlap the first three to get a smooth closed curve. Here's an applet i found that makes it pretty simple to understand
 
http://www.cse.unsw.edu.au/~lambert/splines/CatmullRom.html
 
ryan
« Last Edit: Jul 30th, 2004, 7:08am by skloopy »  
Pages: 1 

« Previous topic | Next topic »