Results 1 to 4 of 4

Thread: can't select objects at all!...

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    12

    can't select objects at all!...

    hi all,

    i'm newbie in openGL. I try to make a 3D office planner. I use Visual C++ 2008 Express Edition and latest version of openGL. I still don't understand exactly how things work although I can draw/rotate/etc.. objects. the thing that I want is to be able to select an object however I can't successfully embed the codes I found on the net... Could you please help me about this situation? my main() and gfxinit() are above:

    ....
    void main(int argc, char **argv)
    {
    glutInit(&argc,argv);
    gfxInit();
    glutDisplayFunc(drawScene);
    glutKeyboardFunc(processKeyboard);
    glutMotionFunc(processMouseMotion);
    glutMouseFunc(processMouse);
    glutMainLoop();
    }
    ....
    void gfxInit()
    {
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowPosition(0,0);
    glutInitWindowSize(winWidth,winHeight);
    glutCreateWindow("MyViewer");

    glShadeModel(GL_FLAT);
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background

    glMatrixMode(GL_PROJECTION); // Set the current openGL matrix to GL_PROJECTION ie projection matrix.
    glLoadIdentity(); // Load identity values in the above.
    gluPerspective(70.0, (GLfloat)winWidth/(GLfloat)winHeight, 1.0, 500.0);

    glMatrixMode(GL_MODELVIEW); // Change the current matrix mode to Model-View matrix.
    glLoadIdentity();

    glClearColor (0.0, 0.0, 0.0, 0.0); // Set the background color to black.

    glEnable(GL_DEPTH_TEST);
    glEnableClientState(GL_VERTEX_ARRAY);
    }
    ....

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2009
    Posts
    126

    Re: can't select objects at all!...

    How do you mean "select an object" ? By clicking on it ?


    ^^


  3. #3
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    12

    Re: can't select objects at all!...

    yes... the code is my current code and has nothing for seection. my problem is how to and where to add stuff? A simple 3D selection c++ code also works for me.

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: can't select objects at all!...

    Old style GL selection is quite easy for a start :
    http://www.opengl.org/resources/faq/...n.htm#sele0020

Similar Threads

  1. Select GPU
    By santyhamer in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 05-25-2010, 12:54 PM
  2. How to select objects in 3D?
    By jojo555 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-22-2004, 08:06 AM
  3. Select only fully enclosed objects
    By teame in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 11-16-2003, 02:22 AM
  4. How to select objects while they are overlapping each other?
    By jiangerlai in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-25-2003, 01:29 AM
  5. How would I select Individual objects??
    By shanedudddy2 in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 01-12-2003, 09:58 AM

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