Why are you passing a non-zero value in for the stride?


I would expect the stride to be zero.



On Friday, March 15, 2013 3:47:29 PM UTC-5, Braindrool wrote:
>
> That's not really the issue, just can't figure out what's wrong with this
>
>  public void onDrawFrame(GL10 unused) {
>>
>>  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
>>
>>
>>>  long time = SystemClock.uptimeMillis() % 10000L;
>>
>>  float angleInDegrees = (360.0f / 10000.0f) * ((int) time);
>>
>>
>>> Matrix.setIdentityM(ModelMatrix, 0);
>>
>>  Matrix.rotateM(ModelMatrix, 0, angleInDegrees, 0.0f, 0.0f, 1.0f);
>>
>>  Matrix.rotateM(ViewMatrix, 0, angleInDegrees, 0.0f, 0.0f, 1.0f);
>>
>>
>>>  draw("models/monkey.ply");
>>
>>  }
>>
>>
>>> private void draw(String model) {
>>
>>
>>>  float[] MVPMatrix = new float[16];
>>
>>
>>> Matrix.multiplyMM(MVPMatrix, 0, ViewMatrix, 0, ModelMatrix, 0);
>>
>>  Matrix.multiplyMM(MVPMatrix, 0, ProjectionMatrix, 0, MVPMatrix, 0);
>>
>>
>>>  GLES20.glUniformMatrix4fv(MVPMatrixHandle, 1, false, MVPMatrix, 0);
>>
>>
>>> Object[] object = getVBO(model);
>>
>>  int[] vbo = (int[]) object[0];
>>
>>  int[] ibo = (int[]) object[1];
>>
>>
>>>  int stride = 3 * Bytes.sizeOfFloat;
>>
>>
>>> // //////
>>
>>
>>>  GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vbo[0]);
>>
>>
>>> GLES20.glVertexAttribPointer(PositionHandle, 3, GLES20.GL_FLOAT, false,
>>
>>  stride, 0);
>>
>>  GLES20.glEnableVertexAttribArray(PositionHandle);
>>
>>
>>>  GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, ibo[0]);
>>
>>
>>> GLES20.glDrawElements(GLES20.GL_TRIANGLES, getCount(model),
>>
>>  GLES20.GL_UNSIGNED_SHORT, 0);
>>
>>
>>>  GLES20.glDisableVertexAttribArray(PositionHandle);
>>
>>
>>> GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 0);
>>
>>  GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
>>
>>
>>>  }
>>
>>
> On Fri, Mar 15, 2013 at 12:22 PM, bob <b...@coolfone.comze.com<javascript:>
> > wrote:
>
>> Why not start from the BasicGLSurfaceView sample and just make changes to 
>> that?
>>
>> Thanks.
>>
>>
>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to