Re: questions about vertex array object
Posted by
elect on
May 17, 2016; 4:56pm
URL: https://forum.jogamp.org/questions-about-vertex-array-object-tp4036708p4036713.html
DearDaniel wrote
I have two big questions regarding to the VAO. (It might be helpful to understand my question if you know the coding of the gl3 version of hello triangle )
1. How should I store my vertex information into the array? I know it is user-defined but what is the usual practice? I am puzzled because, in the hello triangle version, I saw 5 floats for each vertex but there are no description about their identity. What are they? Why can't just x,y,z,w? Is it recommended to combining the colors and coordinates into a single VAO?
2. Is it recommended to ArrayList to hold the vertex information before packaging it into a buffer? If yes, could you kindly give an example of putting an ArrayList into a buffer usable in opengl3?
If there are any conceptual mistakes in my questions, please fill free to point it out. I am still new to opengl 3. thanks.
Daniel
Hi Daniel,
1) I am in the process of writing a small
wiki, have you already had the chance to take a look at it?
Essentially its a vec2 position followed by a vec3 color
2) It depends on your application and on the ArrayList type