Matrix Multiplication (Open GL behaviour problem)

Why does Open GL draw my object on the origin the first time round when I place my object?
Additional info:

•I have an object which is written/ initialised on the origin? (x = 0, y=0)
•However I call a matrix transformation just after its in draw(); E.G.: draw_shape(); glMatrixLoad();......
•Afterwards the following objects are drawn accordingly but I'm annoyed at the first object which ruins the whole function.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
for (int letter = 0;letter != strlen(s);letter++)

 {

 

 //draw font in array

  qva_Fonts[((int)*s)- 32]-> draw();

  s++;

 

 //loadmatrix Position & Scalling


  gfaaSca[0] = gfFont_Size;

      gfaaSca[5] = gfFont_Size;

          gfaaSca[10] = gfFont_Size;

               gfaaSca[15] = gfFont_Size;


  gfText_PosX += gfFont_Spacing;

     gfaaPos[12] = gfText_PosX;

  gfaaPos[13] = gfText_PosY;


 //multiply matrix

    

  glMultMatrixf(gfaaSca); 

  glMultMatrixf(gfaaPos);

  glLoadMatrixf(gfaaSca); glLoadMatrixf(gfaaPos);  

 }


 glLoadIdentity();

}
Uh well, if you change the transformation matrix after the object is drawn, it obviously won't do anything...
Topic archived. No new replies allowed.