Gl_translate

This is a discussion on Gl_translate within the Game Programming forums, part of the General Programming Boards category; allright correct me if im wrong but: Code: glTranslatef(3.0f, 0.0f, 0.0f); will move the entry (?) point 3 units to ...

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    67

    Gl_translate

    allright correct me if im wrong but:
    Code:
    glTranslatef(3.0f, 0.0f, 0.0f);
    will move the entry (?) point 3 units to the right on the x (seen from 0.0) no matter if you drew another GL_TRIANGLE on another place before that?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786

    Re: Gl_translate

    Originally posted by TeQno
    allright correct me if im wrong but:
    Code:
    glTranslatef(3.0f, 0.0f, 0.0f);
    will move the entry (?) point 3 units to the right on the x (seen from 0.0) no matter if you drew another GL_TRIANGLE on another place before that?
    Yes....it will move 3 points from the origin (wherever that may be at the time).

    You can draw in a place you have drawn before, but how it comes out depends on the z order and if you have any sort of blending set

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    67
    so
    Code:
    glTranslatef(0.0f, 0.0f, 0.0f);
    will always but the point in the middle of the screen as it were?

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Originally posted by TeQno
    so
    Code:
    glTranslatef(0.0f, 0.0f, 0.0f);
    will always but the point in the middle of the screen as it were?
    If the origin is set to the middle (because it will have no effect).....

    [edit]
    if you want to move to the middle, call glLoadIdentity()

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    67

    thanks

    ah i see now thanks !

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21