Thread: OpenGL question

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    46

    OpenGL question

    Would this forum be the correct place to ask questions about OpenGL or computer graphics in general?

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Yes.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Yes it is.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Yes OpenGL questions and other graphic questions can go in this forum, as long as its not windows api you want to ask about, then you should try the windows forum.

    Edit: Damn! Beaten!
    Last edited by Shakti; 11-06-2004 at 01:16 PM.

  5. #5
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    *points and laughs at all three of you posting at the same time*


  6. #6
    Registered User
    Join Date
    Sep 2004
    Posts
    46
    Ok great, I recently bought a few books on computer graphics and openGL. I am attempting to self teach myself a lot of the material before I take a class next semester. However, I am a little rusty on my matrix math and this question has to do with model-view matrix. I believe this question has to do with taking a translation and rotation matrix and multiplying them together, anyway here is the question provided in the book:

    You have a satellite rotating around the earth. Its position is above the earth and stated in polar coordinates. I need to find a model-view matrix that keeps the viewer looking at earth.

    I also have noted that the matrix could be used to show the earth as it rotates.

  7. #7
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    Just remember that when dealing with matricies: A * B != B * A

    let's take your planet Earth example, and give you a roation matrix that rotates 90 degrees on the y, and a translation matrix that translates <0, -10, 0> (remember, right handed system). Let's also say that the Earth model with no translation or rotation has the North pole pointing along the positive Z axis.

    Rotation * Translation = Earth infront of you and a little to the left, and the North pole still pointing at the viewer.

    Translation * Rotation = Earth directly in front of you, and the North pole pointing somewhere to your right.

    You don't need to keep the Translation and Rotation matricies seperate, but you'll get the same results. There are several ways you can get the correct matrix, so just try some different operations and see which one seems most intuitive to you. It sounds like you'll be dealing with multiple objects as well, so might want to check out glPushMatrix and glPopMatrix instead of always loading the identity. Or, if you're really interested in the math part of it, you can multiply the current model view matrix by it's inverse to get back to the origin for sheer kicks and giggles.
    Last edited by skorman00; 11-07-2004 at 04:00 PM.

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, 02:40 AM
  2. Opengl question
    By Shadowwoelf in forum Windows Programming
    Replies: 3
    Last Post: 06-03-2007, 01:21 PM
  3. OpenGL Camera Question
    By Astra in forum Game Programming
    Replies: 2
    Last Post: 03-25-2007, 01:53 PM
  4. OpenGL Question
    By Shamino in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2005, 02:35 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM