I am coding a sidescrolling Jump n' Run game in C# using the Open TK Framework. In order to enable a sidescrolling effect, i would add a fixed value to all X coordinates of my Vector3 which is part of an PrimitiveType.Quad. All my platforms, which I build of multiple quads are stored inside a linked list so that i can iterate through it.
My question is, should i add a fixed constat to all coordinates, which would require to iterate my list of platforms
OR
is it preferable to update the objects X component, and then translate it using GL.Translate(x, y, z)?
Which method is better in context of performance? Should i rather translate my camera to the side (which would also require to call a translate function in background as i am concerned)?
public void Move() {// is applied on a platform object
posX -= 0.015;
A.X -= 0.015; // A-H are Vector3
B.X -= 0.015;
C.X -= 0.015;
D.X -= 0.015;
E.X -= 0.015;
F.X -= 0.015;
G.X -= 0.015;
H.X -= 0.015;
}
this.gameObjects.drawObjects();
//method that iterates through linked list and draws platform objects
or better only update posX and using the Translate(); method:
GL.LoadIdentity();
GL.Translate(posX, 0.0f, -3.5f);