Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenGL ES multiple objects not being rendered
    text
    copied!<p>I am doing the following to render multiple balls move around the screen but only 1 ball is seen to appear and function. I don't know why the rest (count-1) balls are not being drawn</p> <pre><code> public void onDrawFrame(GL10 gl) { // TODO Auto-generated method stub gl.glDisable(GL10.GL_DITHER); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glClientActiveTexture(DRAWING_CACHE_QUALITY_HIGH); gl.glLoadIdentity(); for(int i=0;i&lt;mParticleSystem.getParticleCount();i++){ gl.glPushMatrix(); gl.glTranslatef(mParticleSystem.getPosX(i), mParticleSystem.getPosY(i), -3.0f); gl.glScalef(0.3f, 0.3f, 0.3f); gl.glColor4f(r.nextFloat(), r.nextFloat(), r.nextFloat(), 1); gl.glEnable(GL10.GL_TEXTURE_2D); mParticleSystem.getBall(i).draw(gl); gl.glPopMatrix(); } } </code></pre> <p><strong>EDIT</strong> My void draw(GL10 gl) method</p> <pre><code> public void draw(GL10 gl){ gl.glEnable(GL10.GL_CULL_FACE); gl.glEnable(GL10.GL_SMOOTH); gl.glEnable(GL10.GL_DEPTH_TEST); // gl.glTranslatef(0.2f, 0.2f, -3.0f); // gl.glScalef(size, size, 1.0f); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertBuff); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, points/2); gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); } </code></pre> <p>I couldnt take the snapshot on my Samsung Phone but here is the emulator screenshot. In reality, the ball moves around with change in orientation and acceleration and keeps changing color randomly (due to r.nextFLoat()) . However, the other 35 balls arent even being rendered as you can see. How can I fix this?</p> <p><img src="https://i.stack.imgur.com/hu94T.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload