Results 1 to 3 of 3

Thread: matrix storage and Window reset problems

  1. #1
    Guest

    matrix storage and Window reset problems

    Hi,
    I have 2 problems

    1. I want to store the current matrix in a variable or array. I can't figureout what might be the order of the matrix and I don't know the "store function"

    2.I have only one window. I have 2 rooms as models. room 1&2 are seperate models connected by a door. When I walk out of the door of room 1 I have to enter room 2. This means I have to clear & reset the window and load the room 2. How to do this?

    do I have to write 2 cpp files for room 1&2? in that case how & where to link these to load the model to the window?

    thanks guys
    Angelo

    p.s: I'm a student

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: matrix storage and Window reset problems

    GLfloat GLtransform[16];

    glGetFloatv(GL_MODELVIEW_MATRIX, GLtransform);

    Can't remember which way it goes, it is in the red book though. Or search this list

    myDraw()
    {
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    if(room1)
    {
    DrawRoom1();
    }
    else if(room2)
    {
    DrawRoom2();
    }
    else
    {
    MyError(NO_ROOM);
    }
    SwapBuffers();
    }

  3. #3
    Guest

    Re: matrix storage and Window reset problems

    thanks gavin

    I wrote the program as you said. but I have a problem.

    It loads the first model and when i come out of the model(using z condition) It's not displaying the 2nd model. do i have to reset the window or anything like that?

    Please guys help me

    here is the layout of the prog


    initialisation

    main()..
    ....

    initGL()
    ...

    window_display()
    {
    glLookat...
    init_scene();
    glutSwapBuffers();
    }

    init_scene()
    {
    if z<=2
    {
    draw model1
    }
    else
    {
    draw model2
    }

    move()
    {
    if s=1
    increment z
    else
    decrement z
    }

    keyboard()
    {
    check for "up" arrow then s=1;
    check for "down"arrow then s=0;
    }

    windowreshape()
    ...

Similar Threads

  1. Shader Matrix Storage
    By glfreak in forum OpenGL: GLSL
    Replies: 4
    Last Post: 01-19-2011, 07:36 PM
  2. How to reset the OpenGL window?
    By helenyyh23 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-11-2004, 02:43 PM
  3. Matrix Problems...
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-26-2001, 11:37 AM
  4. Matrix problems
    By KRONOS in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-22-2000, 02:54 AM
  5. Does wglMakeCurrent reset the projection matrix?
    By skippyj777 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-23-2000, 03:12 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