Q:

translate iphone opengl es code into libgdx code

in this posting http://www.badlogicgames.com/wordpress/?p=504 Mr. libgdx Mario writes:

OpenGL from the ground up: an extremely well written tutorial series on OpenGL ES 1.x.  Covers all the basics you need to get started with OpenGL.  Note that the tutorial is written for the IPhone and uses Objective C/C++.  This shouldn’t be a big problem though as the API is the same. 

To my shame, I wasn't able to get a libgdx aequivalent of the very first example in that  tutorial running, which is this:
- (void)drawView:(GLView*)view;
{
    Vertex3D    vertex1 = Vertex3DMake(0.0, 1.0, -3.0);
    Vertex3D    vertex2 = Vertex3DMake(1.0, 0.0, -3.0);
    Vertex3D    vertex3 = Vertex3DMake(-1.0, 0.0, -3.0);
    Triangle3D  triangle = Triangle3DMake(vertex1, vertex2, vertex3);

    glLoadIdentity();
    glClearColor(0.7, 0.7, 0.7, 1.0);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glEnableClientState(GL_VERTEX_ARRAY);
    glColor4f(1.0, 0.0, 0.0, 1.0);
    glVertexPointer(3, GL_FLOAT, 0, &triangle);
    glDrawArrays(GL_TRIANGLES, 0, 9);
    glDisableClientState(GL_VERTEX_ARRAY);
}

my code...
public void render () {
    Gdx.gl11.glLoadIdentity();
    Gdx.gl11.glRotatef(rotation, 0.0f, 0.0f, 1.0f);
    Gdx.gl11.glClearColor((float)0.7, (float)0.7, (float)0.7, (float)1.0);
    Gdx.gl11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
    Gdx.gl11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
    Gdx.gl11.glColor4f((float)1.0, (float)0.0, (float)0.0, (float)1.0);
    Gdx.gl11.glVertexPointer(3, GL11.GL_FLOAT, BYTES_PER_VERTEX, vertices);
    Gdx.gl11.glDrawArrays(GL11.GL_TRIANGLES, 0, 9);
    Gdx.gl11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
}

The problem here is 'vertices'.  I have no idea what that should be.  After lots of googling I came up with:
final int BYTES_PER_VERTEX = (3 + 4) * 4;

public void create () {
    ByteBuffer buffer = ByteBuffer.allocateDirect(BYTES_PER_VERTEX * 3);
    buffer.order(ByteOrder.nativeOrder());
    vertices = buffer.asFloatBuffer();

    float[] verts = {
            0.0f, 1.0f, 0.0f, 1, 0, 0, 0,
            1.0f, 0.0f, 0.0f, 0, 1, 0, 0,
            -1.0f, 0.0f, 0.0f, 0, 0, 1, 0};

    vertices.put(verts);
    vertices.flip();
}

.  and that seems to be displaying a triangle, but the values for the vertices are not the same as in the original example (z value is 0 instead of -3, in which case I wouldn't see anything). 
Can anyone shed any light on vertices? 

A:

Here's what I have.  I create a square instead of a triangle but you get the jist.  A lot of the random code that is in the iphone tutorial is taken care internally.  You can actually dissect the source of libgdx if you are curious how (in java) it's going about the calls internally (camera management, mesh management, etc). 
in create() :
mesh = new Mesh(true, 4, 4, 
            new VertexAttribute(Usage. Position, 3, "a_position"),
            new VertexAttribute(Usage. ColorPacked, 4, "a_color"));

mesh.setVertices(new float[] {
             -1.0f, -1.0f, -3.0f, Color.toFloatBits(255, 0, 0, 255),
              1.0f, -1.0f, -3.0f, Color.toFloatBits(255, 0, 0, 255),
             -1.0f,  1.0f, -3.0f, Color.toFloatBits(255, 0, 0, 255),
              1.0f,  1.0f, -3.0f, Color.toFloatBits(255, 0, 0, 255)});

mesh.setIndices(new short[] { 0, 1, 2, 3 });

in resize()
float aspectRatio = (float) width / (float) height;
camera = new PerspectiveCamera(67, 2f * aspectRatio, 2f);
camera.near = 0.1f;
camera.translate(0, 0, 0);

in render() 
Gdx.gl11.glClearColor(0.7f, 0.7f, 0.7f, 1.0f);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
mesh.render(GL10.GL_TRIANGLE_STRIP, 0, 4);

Hope that helps. 
Resources:
http://dpk.net/2011/03/07/libgdx-cubes-handling-inputs-in-applicationlistener-render/
http://www.badlogicgames.com/wordpress/?p=2032

