小编sav*_*sun的帖子

libgdx point light not working on generated mesh

I've been trying to illuminate plane meshes generated by the following:

private Model createPlane(float w, float h, Texture texture) {
   Mesh mesh = new Mesh(true, 4, 6, new VertexAttribute(Usage.Position, 3, "a_position"),
           new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoord0"),
           new VertexAttribute(Usage.Normal, 3, "a_normal")); 

   float w2 = w * this.CELL_SIZE;
   float h2 = h * this.CELL_SIZE;

    mesh.setVertices(new float[]
            { w2, 0f, h2, 0, 0, 0, 1, 0,
            w2, 0f, -h2, 0, h, 0, 1, 0,
            -w2, 0f, h2, w, 0, 0, 1, 0,
            -w2, 0f, …
Run Code Online (Sandbox Code Playgroud)

3d android opengl-es libgdx

10
推荐指数
1
解决办法
1413
查看次数

标签 统计

3d ×1

android ×1

libgdx ×1

opengl-es ×1