OpenGL Question?

This is a discussion on OpenGL Question? within the Game Programming forums, part of the General Programming Boards category; What i am doing is making a 3D Checkers game that when its a different players turn the board spins ...

  1. #1
    TheGr8one
    Guest

    OpenGL Question?

    What i am doing is making a 3D Checkers game that when its a different players turn the board spins around, I know how to spin the board with glRotatef but how would i make it a different function if the original drawing of the board is in a different function. Any ideas?

    Thanks
    Chris

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    are you saying you have two functions and you want to do such

    ??? function1(???)
    {
    // draw the chessboard
    }

    //elsewhere in the code
    ??? function2(???)
    {
    // rotate the chessboard here
    }

    is this what your trying to do?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Malek
    Guest
    Well, you could put a glRotatef in the drawing function, and rotate it THETA degrees, then make THETA a global variable and change it (say from 0 to 180) in the other function.

    Or you might want to take a look at the gluLookAt() function, and then you could just change the position of the camera and swing it around the board, showing you the board from another view.

  4. #4
    TheGr8one
    Guest
    How do u use gluLookAt() function?

  5. #5
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    void gluLookAt(
    GLdouble eyex,
    GLdouble eyey,
    GLdouble eyez,
    GLdouble centerx,
    GLdouble centery,
    GLdouble centerz,
    GLdouble upx,
    GLdouble upy,
    GLdouble upz
    );

    Parameters

    eyex, eyey, eyez
    The position of the eye point.

    centerx, centery, centerz
    The position of the reference point.

    upx, upy, upz
    The direction of the up vector.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL Question
    By Halo3Master in forum Game Programming
    Replies: 16
    Last Post: 10-02-2007, 03:40 AM
  2. Opengl question
    By Shadowwoelf in forum Windows Programming
    Replies: 3
    Last Post: 06-03-2007, 02:21 PM
  3. OpenGL Camera Question
    By Astra in forum Game Programming
    Replies: 2
    Last Post: 03-25-2007, 02:53 PM
  4. OpenGL Question
    By Shamino in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2005, 03:35 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM

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