In OpenGl ES 2, should I allocate multiple transformation matrices?
- by thm4ter
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
}
}