OpenGL 1.0 to 2.0 Triangle Fan

Hello there!

I’m currently following this cocos2d tutorial series and I found out that this is OpenGL 1.0. The problem is libgdx uses OpenGL 2.0, there is no glEnableClientState and glDisableClientState. Can any one tell me the equivalent for OpenGL 2.0 or any tutorial about this or triangle fan?

Thanks!

Triangle fans are a fairly low-level concern. Although you certainly can dig down to that level if you want, it’s kind of tangential to physics simulation (which appears to be the subject of the tutorial you linked to).

Could you bypass that aspect of the tutorial and just use a ‘circle’ texture instead? LibGDX has high-level support for quad/sprite rendering, which it seems would be sufficient for this.

What do you mean bypass, you mean use a plain circle? As much as possible we want the jelly/squishy effect. :frowning:

Thanks!

I see. I watched the video in your link, so I see what you’re talking about. Although you can achieve some deformation effects using simple transforms (scale, shear), it looks like a custom mesh would indeed be more suitable for what you’re wanting.

The ‘triangle fan’ part is just a detail, for what it’s worth; you could render the ball using a fan, or indexed triangles, or whatever and get the same result. A fan is a reasonable choice for a circle, but it’s not a requirement. (Also, if you’re deforming the circle you may have to be careful about reversed windings. Maybe the tutorial covers that.)

As for the OpenGL version issue, I’m not sure what all LibGDX exposes, but you might double check and see if it exposes the functionality you’re wanting to use. Although it is deprecated and/or absent in modern OpenGL, it may still be exposed by LibGDX. If it’s not available, then you’ll want to look into VBOs, which are the modern equivalent (more or less) of the client-side arrays used in the tutorial. It may also be the case that LibGDX has some higher-level mesh-related functionality that will take care of these details for you.

I just found out that this is called ‘blob’ or ‘softbody’ but unfortunately I have no idea where should I started. (opengl, mesh, vbo, etc)

thanks!