Geometry batching

Hello JGO, I’d like to know if anyone can provide tutorials or code on this topic.

I want to have a system that creates VAOs or VBOs and renders them in an immediate mode-like way;

GeometryBatch batch = new GeometryBatch(4, TEXTURE_WALL);

batch.begin();

batch.rotate(30, 0, 0);
batch.translate(2, 0, 5);
batch.addTexturedNormaledVertex(0, 0, 0, u0, v0, n0x, n0y, n0z);
batch.addTexturedNormaledVertex(1, 0, 0, u1, v1, n1x, n1y, n1z);
batch.addTexturedNormaledVertex(1, 1, 0, u2, v2, n2x, n2y, n2z);
batch.addTexturedNormaledVertex(0, 1, 0, u3, v3, n3x, n2y, n2z);

batch.end();

and after that I can either

batch.render();

without clearing the batch or do the batch.begin(); and batch.end(); parts to reset and rewrite the batch.

Thanks!

com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer20

Doesn’t seem to contain rotation though. Also depends on a lot of other library specific classes

Rotation/translation/etc is achieved by setting a different projModelView matrix.

Of course it depends on a lot of other classes. ::slight_smile: If you can’t be arsed to write your own ShaderProgram, Mesh, and other utilities, then you should probably not be trying to write your own 3D engine in the first place. It would make more sense to use LibGDX or another framework (Ardor3D, jME, jPCT, etc) to do the heavy lifting for you.