Beginner question: appropriate container for vertices and normal coordinates ?

Hallo everybody,

I am storing coordinates of a 3d model within 3 ArrayLists. One List for the vertices, 1 for the normals and one for the faces. It is working as long as there are not too many vertices in one 3d model. Trying to load a model consisting out of 12000 vertices for example causes trouble because I get an error indexoutofboundException or even a unknownsource exception when trying to get one element out of one list by using the get() method (for ArrayLists).
Isn’t an ArrayList self-managing in “how much space is needed” for the 3d model ?

Or is the another “Container, Array, otherList,…” which is much better to store these coordinates when there are a lot of it?

Thanks, with kind regards
Alexander

You’re most likely doing something terribly wrong. There is nothing wrong with ArrayList no matter how many elements they contain.

Going more into this though, why using ArrayList in the first place? That’s such a waste of memory! What’s wrong with storing them in a FloatBuffer directly?