r/GraphicsProgramming • • Apr 07 '21

I tried making a squishy sphere simulation in OpenGL but something went wrong and I invented a new geometrical entity again.

233 Upvotes

13 comments sorted by

11

u/PastaThis Apr 07 '21

Maybe your index to the vertices are wrong. Did you get a sphere rendering first?

17

u/[deleted] Apr 07 '21

something like that, actually. I had q = vertices[i] instead of q = vertices[indices[i]], if that makes sense :)

4

u/Mister-Perfect Apr 07 '21

Do you have a gif/video of where it works? I’m quite interested in the result

2

u/[deleted] Apr 08 '21

It isn't fully working yet, I will make a new post when it does.

1

u/Mister-Perfect Apr 08 '21

Ah okay, thanks!

4

u/[deleted] Apr 07 '21

If anyone's interested, I'm trying to connect vertices by "springs" and update each frame with Euler method.

2

u/Flannelot Apr 07 '21

something something normal recalculation?

4

u/CodyDuncan1260 Apr 07 '21 edited Apr 07 '21

*stares carefully at post*This is awfully close to only showing the render and not talking about how it's programmed and works / supposed to work. This is borderline violation of Rule 1. I might have to remove this.

Pinging u/tirolskiypirog7. To get this up-to-code with Rule 1, How is the squishy supposed to work?

2

u/[deleted] Apr 08 '21

You're just jealous because you don't have a cool sphere!

On a serious note, I connected vertices in each triangle with a spring and ran a simulation updating Lagrange equations with forward Euler. The shader is just outputting UVs as color.

3

u/CodyDuncan1260 Apr 08 '21

100% PB&Jelly over here.

6

u/fit4EPICness Apr 07 '21

Mozilla Firefox icon but its a cat hairball

2

u/khinbaptista Apr 07 '21

the colors are very pretty