screw up obj files indices and vetices when trying to index an unindexed one #372
-
this is my code : ` for (int i = 0; i < g_model.model.meshCount; i++) {
} ` and this what happend: i am using the raylib library and i load obj files that are not indexed |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please refer to something like this as an example: https://github.com/zeux/meshoptimizer/blob/master/demo/main.cpp#L128-L136 In your code one thing that stands out immediately is that you're passing sizeof(float) as vertex size, whereas instead you should be passing the size of the entire vertex - which is typically at least 12 bytes (3 floats), but here likely to be more. |
Beta Was this translation helpful? Give feedback.
Please refer to something like this as an example: https://github.com/zeux/meshoptimizer/blob/master/demo/main.cpp#L128-L136
In your code one thing that stands out immediately is that you're passing sizeof(float) as vertex size, whereas instead you should be passing the size of the entire vertex - which is typically at least 12 bytes (3 floats), but here likely to be more.