Re: questions about vertex array object
Posted by
DearDaniel on
May 18, 2016; 4:00am
URL: https://forum.jogamp.org/questions-about-vertex-array-object-tp4036708p4036714.html
I understand now. Thanks for the small wiki. I am reading it now. So glad to see a proper tutorial on opengl 3(I can't find one from the internet, especially for java). That is very helpful. That solves most of my questions.
So, one last minor question. Is the z coordinate default to be 0? If I use vec2 to represent the coordinate.
If I wanted to add the z coordinate, how should I inform the opengl to set the coordinate? My guess after reading the small wiki is that just increase the offset in the gl3.glVertexAttribPointer() from offset = 2 * Float.BYTES to offset = 3 * Float.BYTES. But, is opengl smart enough to know that the new float is the z coordinate of the vertex?
Never Stop ... Learn more ... Be humble ...