Adding springs to an icoSphere

edited February 2018 in How To...

Hi !

I'm trying to make a 3D blob just like this one:

The process is rather simple:

  • draw an icoSphere made of TRIANGLE_STRIPS
  • connect each vertex of this icoSphere by springs (essentially recreating the icosphere’s mesh)
  • add some repulsion force to each vertex (particle) to make the whole thing bouncy

I've managed to make the icosphere: https://imgur.com/a/xuZed

But when I connect the vertices by springs (and add some repulsion force), all I get is this giant 3D pillow:

https://media.giphy.com/media/t8cVwnIxTAPleECoUF/giphy.gif

As you can see, it seems the icosSphere is unfolding.

2 questions:

  • Is it because I made a mistake in the spring connections (if so, can someone please explain me where exactly ?)

  • Or is it due to the springs making the icoSphere completly lose its shape ?

Note: I'm using Python mode. But the question is more about the process (springs connections) rather than the code itself.

Answers

  • Answer ✓

    are the tops and bottoms of your sphere triangle fans? typically spheres have a single point at each of the poles.

  • edited February 2018

    The tops and bottoms are made of TRIANGLE_STRIPS (not triangle fans) and I don't think there's a single point at each pole: https://imgur.com/a/xuZed

    Edit: I guess poles are made of the tops of different triangle_strips

  • which is why it looks like a pillow...

  • Hmm, I don't think that's the main problem here because even if I make a knot and tightly tie the tops of these triangle_strips (for each pole), the whole thing should look like a pumpkin. And yet I still get that strange unfolding motion at the beginning of the sketch.

    Anyway, I'm going to make another icoSphere (a real one this time I guess) following your suggestion. I just hope using triangle_fan instead of triange_strip won't be too difficult.

    Thanks

  • edited February 2018

    @koogs: Would you mind sharing some advices on how to make an icosphere with triangle_fans ? I have all the vertices positions stored in a 2D array list but cannot figure out how to draw the icosphere using the TRIANGLE_FAN parameter

  • Also is it possible to draw a sphere made of both triangle strips and triangle fans (only at the poles for instance) ?

  • If you start another thread for the same question it confuses people. Do I answer here or there? Keep things together.

  • @koogs: I'm confused (being used to stackoverflow). This question is about adding springs to an icosphere, not about drawing the icosphere. I don't mind at all keeping things toghether if you prefer but won't that be confusing for other readers ?

    Anyway I'd love to read your answer, be it here or on the other thread. :)

  • it's the same code so it's the same question. you don't want two different threads where people are adding bits to the same code.

  • edited February 2018

    Yeah... except it's not the same code. I didn't even post code here. Not to mention that you can have various questions regarding a single piece of code. Is that your answer ?

  • edited March 2018

    @solub -- you are right, things do work a bit differently on this forum than on stackoverflow. The key thing here is that you are working on a single, specific icosphere project with a set of connected criteria, and asking closely related questions about different aspects of it. A relatively small community of people (dozens, not thousands) would rather ask you for a set of related MCVEs in a single thread as the project grows -- not ask you for similar MCVEs several times, and not search across multiple forum threads to get the same context for each. Later, if someone else wants to make a springy box mesh or rebounding icospheres, it might also make more sense to have one thread to point them to.

    If you have a project with two discrete components -- say, sonifying camera data, and rendering shapes -- then the unrelated MCVEs should be separate threads. However, if both your MCVEs would be based on related methods in the same class, just keep it all in one thread and add new related questions to that thread as your class evolves.

  • @jeremydouglass: I appreciate you took the time to explain and clarify your policy /guidelines regarding questions on this forum. Thank you.

Sign In or Register to comment.