List of usage examples for com.badlogic.gdx.graphics.g3d.model MeshPart MeshPart
public MeshPart(final String id, final Mesh mesh, final int offset, final int size, final int type)
From source file:com.mbrlabs.mundus.commons.terrain.Terrain.java
License:Apache License
public void init() { final int numVertices = this.vertexResolution * vertexResolution; final int numIndices = (this.vertexResolution - 1) * (vertexResolution - 1) * 6; mesh = new Mesh(true, numVertices, numIndices, attribs); this.vertices = new float[numVertices * stride]; mesh.setIndices(buildIndices());//from w w w. ja v a 2 s .co m buildVertices(); mesh.setVertices(vertices); MeshPart meshPart = new MeshPart(null, mesh, 0, numIndices, GL20.GL_TRIANGLES); meshPart.update(); ModelBuilder mb = new ModelBuilder(); mb.begin(); mb.part(meshPart, material); model = mb.end(); modelInstance = new ModelInstance(model); modelInstance.transform = transform; }