Question

Trying to parse an OBJ (wavefront) file to draw it in OpenGL ES20 I'm facing a problem I don't know how to address/solve:

The file has exactly 50,000 (50k) vertices, all being used in faces. When I'm loading the object, I'm parsing faces into indices, which have to be UNSIGNED_SHORT, which unfortunately is not available in Java, I'm using Shorts, which end at rougly 32k. Since I'm having more vertices and faces than this, I'm getting a NumberFormatException.

How should I address this issue without removing vertices? Any work-around?

Was it helpful?

Solution

What library are you using that exposes OpenGL API without supporting this ? If it is just a numeric problem, you can get away with it by anyhow using the number using the same approach as discussed in java opengl: glDrawElements() with >32767 vertices

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top