Getting Vertices From a Quad or Adding Quads to a Mesh

I am generating arrays of quads for my LOD algorithm and I was wondering if there was a way to add each quad to a mesh as to avoid creating a geometry for each quad. Also this could be avoided if the vertices of the quad could be extracted. All help is appreciated, thanks.

You can do this by creating a custom mesh and avoiding Quad altogether.

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes

Ok I’ll give that a try. I was trying to avoid the mesh route as I thought it was easier to just adjust the length and width of the quads. Thanks for the help.

@okelly4408 said: Ok I'll give that a try. I was trying to avoid the mesh route as I thought it was easier to just adjust the length and width of the quads. Thanks for the help.

If you look at Quad.java it is a trivially simple class. And it sounded like from your original post that you are generating something that is not a quad… but many quads. In which case, it no longer makes sense to use quad on its own, I think.

I thought you were asking how to avoid the overhead of creating separate quads, wrapping them in Geometry objects, and then batching them. There is only one way: a custom mesh.

Right, but in my case it was easy just to make a 2d array of quads and subdivide each one for the LOD algorithm, although the cost of creating a geometry for each one was too much. I got a rough version of it working using a mesh now. Appreciate the help.