Login  Register

Re: Loading attributes in a packed buffer?

Posted by gouessej on Dec 11, 2012; 10:11am
URL: https://forum.jogamp.org/Loading-attributes-in-a-packed-buffer-tp4027450p4027478.html

As you can see in the source code, I use GL_T2F_V3F, it means 2 texture coordinates followed by 3 vertex coordinates. In your case, it would rather be GL_V3F_C4F_N3F but it doesn't exist, rather use GL2.GL_C4F_N3F_V3F and put the data into your direct NIO buffer in this order: R G B A NX NY NZ X Y Z. Another solution consists in using glVertexPointer, glColorPointer and glNormalPointer but with different values for the "stride" parameter, it would allow you to do exactly what you want, it is more flexible than glInterleavedArrays.
Julien Gouesse | Personal blog | Website