Results 1 to 2 of 2

Thread: Selection Problems

  1. #1
    Guest

    Selection Problems

    Selection has been giving me some grief.
    I seem to be able to select the player and level but when i add my list of monsters. the program starts to get inaccurate results or none at all. any ideas?

    void GameClass::PickScene()
    {

    glPushMatrix();

    glTranslatef(0.0f, 0.0f, -28.0f);
    glRotatef(45.0f, 1.0, 0.0f, 0.0f);

    glPushMatrix();

    camera->ApplyCameraTransform();

    glInitNames();
    glPushName(0);

    // draw the ground
    glLoadName(LEVEL);
    m_theLevel->DrawLevel();

    // draw the player
    glLoadName(PLAYER);
    m_player->DrawModel();

    for(int i=0; i<monsters.getListSize();i++)
    {
    glLoadName(m_monsters.getData(i).name);
    DrawMonster(m_monsters.getData(i));
    }

    glPopMatrix();

    glPopMatrix();

    SwapBuffers(m_hDC);
    }

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Location
    San Diego, CA, USA
    Posts
    209

    Re: Selection Problems

    I dont see you going into the picking/selection render mode... I suppose you do that elsewhere? Anyways, what you need to do is create a pickmatrix which needs to be multiplied into your projection matrix before you multiply in your ortho or perspective projection matrix. Don't load your ortho or perspective matrix, I did that and ended up with a picker that picked everything visible

    anyways, one thing I did notice... you dont need to swap buffers. When in selection mode, you're not actually drawing, so that particular rendering mode won't actually modify your buffers at all.

Similar Threads

  1. Problems with (selection mode) picking
    By Phoresis in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-06-2007, 01:06 AM
  2. Selection problems
    By AleksX in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-31-2002, 11:26 PM
  3. Selection problems 2
    By AleksX in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 07-18-2002, 06:35 PM
  4. Back Buffer Selection Problems
    By JohnWesterman in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 06-28-2002, 02:04 AM
  5. Kyro II Selection Buffer problems
    By vokesalex in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-22-2002, 03:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean