Android GL_FLOAT convert to GL_SHORT in an OpenGL ES vertex array
float coords[] = {
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
1.0f, 1.0f, 0.0f,
1.1f, 2.3f, 0.0f,
}
i have a simple coord array in floats. How I can convert it to GL_SHORT?
so not this: gl.glVertexPointer(dimension, GL10.GL_FLOAT, 0, mVertexBuffer);
but: gl.g开发者_如何学ClVertexPointer(dimension, GL10.GL_SHORT, 0, mVertexBuffer_short);
The numbers would be exactly the same (as in {0,0,0, 0,1,0, ...}
). If you had fractions you'd have to apply a suitable scaling matrix at render time so that you could represent your points as integers.
精彩评论