Hi,
I have a problem using opengl on android to draw a simple rectangle.
This is what I have done.
I drew a simple rectangle with sketchup. I exported the result using
a 3d-model collada .dae file. I then copied the vertices data from
the .dae (xml) file and put in an array. I copied the array in native
format to a float buffer. I then drew the triangles using stripe
mode. The result is nearly a rectangle. It is missing a triangle on
each surface.
Here is the relevant portion of code and the result.
public void draw(GL10 gl) {
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mVertexBuffer);
// Enable color tracking
gl.glEnable(GL10.GL_COLOR_MATERIAL);
for (int i=0; i<108/4; i=i+4) {
// while (i<(mVertexBuffer.limit()/3)){
myDrawColor(gl,i);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP,i,4);// mode,
first, count
}
}
the result is shown here
http://imgur.com/a/o3HTP
Please advise
John
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en