java - Offsets for per vertex data interleaved in OpenGL ES on Android -


Is it possible to use top peripheral data used in OpenGL ES on Android?

I am unable to get the right offset points for the General and colors members.

I will do something like this in C ++:

  Structure Color vetetaxdata 3D {Vertex 3D Vertex; Vector 3D normal; ColorRGBA color; }; Constant color vetetaxdata 3D vertexdata [=] {{0.0f, 0.5f, 0.8f}, // vertex | {0.0f, 0.4f, 0.6f}, // Normal | Vertex 0 {1.0 F, 0.0F, 0.0F, 1.0F} // Color | }, {{0.8f, 0.0f, 0.5f}, // Vertex | {0.6f, 0.0f, 0.4f}, // General | Vertex 1 {1.0 F, 0.5 F, 0.0 F, 1.0 F} // Color | }, // ... more vertexes}; Const int stride = sizeof (coloredVertexData3D); Glytextex Pointer (3, GL_Flotot, Stride, and Vertix data [0] .VetEX); GlColorPointer (4, GL_flatt, stride, and vertexdata [0] .color); Glanormal Pointer (GL-Floyd, Stride, and Vertex Data [0]. Normal);  

Is Java the only thing possible on Java? This is what I got:

  Bytebuff Vertex data ... ... int stride = 40; Gl.glVertexPointer (3, GL10.GL_FLOAT, Stride, Vertaxdata); // This clearly does not work ------------ v gl.glColorPointer (4, GL10.GL_FLOAT, Stride, and VertexData [0] .color); Gl.glNormalPointer (GL10.GL_FLOAT, Stride, and Vertex data [0]. General);  

The original idea is to duplicate () calls on the bytebuff, which creates a new one Bitebuffer which shares the underlying reserves but allows you to start from a different position.

What worked for me here:

  FloatbuterWritesAnimal; // ... to start the corner, code: normal ... // vertex is the 6 floats for each head. First three // defined position and the next three general defined Gl.glVertexPointer (3, Globe.GL_Flat, 24, VersesAnimal); // Make a buffer, which indicates 3 floats before the beginning. Float Buffer Normal Data = MerchantsNames Duplicate (); NormalData.position (3); Gl.glNormalPointer (gl.GL_FLOAT, 24, standard data);  

Comments