In OpenGl ES 2, should I allocate multiple transformation matrices?

Posted by thm4ter on Game Development See other posts from Game Development or by thm4ter
Published on 2012-03-29T04:37:37Z Indexed on 2012/03/29 5:42 UTC
Read the original article Hit count: 246

Filed under:
|

In OpenGl ES 2, should I declare just one transformation matrix, and share it across all objects or should I declare a transformation matrix in each object that needs it?

for clarification... something like this:

public class someclass{
   public static float[16] transMatrix = new float[16];
   ...
   public static void translate(int x, int y){
      //do translation here
   }
}
public class someotherclass{
   ...
   void draw(GL10 unused){
      someclass.translate(10,10);
      //draw
   }
}

verses something like this:

public class obj1{
    public static float[16] transMatrix = new float[16];
   ...
   void draw(GL10 unused){
      //translate
      //draw
   }
}
public class obj2{
   public static float[16] transMatrix = new float[16];
   ...
   void draw(GL10 unused){
      //translate
      //draw
   }
}

© Game Development or respective owner

Related posts about android

Related posts about opengl-es2