title: how to get current position of every object in scene?
body: <p>I am rendering several square objects in sphere (I am in the center of the sphere and the objects are around me). I am using the phone's Rotation sensor to view the the objects in the sphere.</p>
  
  <p>all the objects start from position around (0,0,0) , but at rendering time I'm rotating each object to a different angle in the sphere .</p>
  
  <p>this is how I handle the matrices until from the moment I get the rotation matrix : </p>
  
  <pre><code>public void position(float[] rotationMatrix , float[] projectionMatrix , float rotationAngle , float xRotation , float yRotation , float zRotation , float xTranslation , float yTranslation , float zTranslation){
  
  
          float[] MVP = new float[16];
  
          float[] modelMatrix = new float[16];
  
          System.arraycopy(rotationMatrix, 0, modelMatrix, 0, rotationMatrix.length);
  
          Matrix.rotateM(modelMatrix, 0, -90f, 1f, 0f, 0f); //correct the axis so that the direction of Y axis is to the sky and Z is to the front
  
          Matrix.rotateM(modelMatrix, 0, rotationAngle, xRotation, yRotation, zRotation); //rotate the object around axis
  
          // used to control the distance of viewing the object (currently only z translation is used)
          Matrix.translateM(modelMatrix, 0, xTranslation, yTranslation, zTranslation);
  
  
  
          Matrix.multiplyMM(MVP , 0 , projectionMatrix , 0 , modelMatrix , 0);
  
          textureShaderProgram.setUniforms(MVP , texture);
  
          return;
      }
  </code></pre>
  
  <p>then in the shader I multiply each object location(which is the same location basically) with this MVP matrix , and they are rendered around in a sphere like world.</p>
  
  <p>this works good . now what I like to do is identify when an object is right in front of me . get each object's location at all times , and when I view a certain object make it selectable or lighted.</p>
  
  <p>but since every object is multiplied several times , how can I know it's location and when I am actually viewing it now ?</p>