如何在Rust OpenGL中编程纹理?

qzlgjiam  于 2022-11-04  发布在  其他
关注(0)|答案(1)|浏览(202)

{"header":{"type":"auto_translation","ret_code":"NullPointerException","time_cost":225.0,"request_id":"446e1e6a5c3a11ed9572a3aa7f779a35"}}

ddarikpa

ddarikpa1#

它们只有3个顶点,但索引从0到3。您还必须指定第4个顶点坐标:

const VERTICES: [Vertex; 4] = [
    [0.5, 0.5, 0.0, 0.5, 0.5],
    [0.5, -0.5, 0.0, 0.5, -0.5],
    [-0.5, -0.5, 0.0, -0.5, -0.5],
    [-0.5, 0.5, 0.0, -0.5, 0.5],
];

const INDICES: [TriIndexes; 2] = [[0, 1, 2], [0, 2, 3]];

相关问题