Terrain.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:Argent 作者:
public void init() {
    final int numVertices = this.vertexResolution * this.vertexResolution;
    final int numIndices = (this.vertexResolution-1) * (this.vertexResolution-1) * 6;

    mesh = new Mesh(true, numVertices, numIndices, attribs);
    this.vertices = new float[numVertices * stride];
    mesh.setIndices(buildIndices());
    buildVertices();
    mesh.setVertices(vertices);

    MeshPart meshPart = new MeshPart(null, mesh, 0, numIndices, GL30.GL_TRIANGLES);
    meshPart.update();
    ModelBuilder mb = new ModelBuilder();
    mb.begin();
    mb.part(meshPart, material);
    model = mb.end();
    modelInstance = new ModelInstance(model);
    modelInstance.transform = transform;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号