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.
IndexDiscussionExhibition › Yet another organic blob.
Page Index Toggle Pages: 1
Yet another organic blob. (Read 1299 times)
Yet another organic blob.
Feb 8th, 2010, 3:19pm
 
My unfinished attempt at an organic-elastic blob in a zero-gravity instance.

If anyone can help me figure out how to seal up the little gaps in my Cartesian sphere equation, I would greatly appreciate it! They are the only things stopping me from putting in a texture which would make it look gorgeous.

ENTER turns on smoothing and will slow down the fastest of machines.
CLICKING shows points only, for fastest performance.
Mouse movement applies force.

http://rdwong.net/archive/jellyBall.zip
Re: Yet another organic blob.
Reply #1 - Feb 9th, 2010, 3:16pm
 
unfortunately i can't help you...
but i like your sketch.

nice work!

Re: Yet another organic blob.
Reply #2 - Feb 10th, 2010, 6:34am
 
this here works a bit better, but there are still some gaps left.

hope this helps a little... but i think there is a better way to solve it, which i haven't found yet...

cheers
j.



i added the "res" after PI


for (float i = 0; i <= PI; i += res) {
   beginShape();
   xRadius = radius - force + force*cos(i + r);
   yRadius = radius - force + force*sin(i - r);
   zRadius = radius - force + force*cos(i - r);
   
   for (float j = 0; j <= PI+res; j += res)
   {
     x = xRadius * sin(i) * cos(j) + xCenter;
     y = yRadius * sin(i) * sin(j) + yCenter;
     z = zRadius * cos(i) + zCenter;
     
     if (showVectors) {
       pushStyle();
       stroke(255, 126);
       point(x, y, z);
       popStyle();
     } else {
       
       
      vertex(x, y, z);
     

     }
   }
   
   for (float j = 0; j <= PI + res; j += res) {
     x = xRadius * sin(i - res) * cos(PI - j) + xCenter;
     y = yRadius * sin(i - res) * sin(PI - j) + yCenter;
     z = zRadius * cos(i - res) + zCenter;
Re: Yet another organic blob.
Reply #3 - Feb 10th, 2010, 3:05pm
 
Thanks Jamone.

I can't believe I didn't try that!
I spent a day adding values to the initial values of the "for" statements. All I had to do was test the end values.

I think the rest of the gaps have to do with the fact that the vertexes are calculated separately with each shape. I wanted to avoid storing them as arrays, but I guess it may be the best way to go.
Re: Yet another organic blob.
Reply #4 - Feb 20th, 2010, 8:32am
 
Hey I tried you sketch. There is lots of artifacts. Are the polygons wrong or is this intentional effect?
Re: Yet another organic blob.
Reply #5 - Feb 21st, 2010, 4:27pm
 
marcin ignac wrote on Feb 20th, 2010, 8:32am:
Hey I tried you sketch. There is lots of artifacts. Are the polygons wrong or is this intentional effect


Hi. I'm not sure what you mean by this.

Basically, I drew polygons based on the cartesian equation of a sphere. What I've been trying to figure out is a way to draw out the surface of a sphere with a single polygon rather than one polygon for each resolution point. I'm fairly sure this is possible without the use of saving the points as array data, just haven't gotten down to figuring it out yet.

It may be the type of sphere equation that I'm using. I might use two individual circle equations to figure this out. One with the angle rotating along the Z-axis, and one with the Y-axis. (Though I'm also fairly sure that this is the current equation I'm using.) I know my trig is terrible. Heh
Page Index Toggle Pages: 1