Skip to content

Faces list contains indices for the raw parsed vertices, not interleaved (repeated) vertices #143

@laralex

Description

@laralex

With the test object:

o Simple
v 1.0 2.0 3.0
v 3.0 5.0 6.0
v 7.0 8.0 9.0
vt 0.0 1.0
vt 1.0  0.0
vt 0.0 0.0
vn 0.0 0.0 1.0
f 2/3/1 1/2/1 3/1/1
f 2/1/1 1/3/1 3/2/1

The interleaved array of vertices is generated correctly:

[0.0, 0.0, 0.0, 0.0, 1.0, 3.0, 5.0, 6.0]
[1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 3.0]
[0.0, 1.0, 0.0, 0.0, 1.0, 7.0, 8.0, 9.0]
[0.0, 1.0, 0.0, 0.0, 1.0, 3.0, 5.0, 6.0]
[0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 2.0, 3.0]
[1.0, 0.0, 0.0, 0.0, 1.0, 7.0, 8.0, 9.0]

The faces reported with scene.mesh_list[0].faces are:

[[1, 0, 2], [1, 0, 2]]

meaning that they don't index the interleaved array, because the second face should be [4, 3, 5]

Any ideas how to achieve interleaved indexing, without it I cannot render in OpenGL using glDrawElements by pushing the interleaved array into a VBO, and faces into an EBO (index buffer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions