Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Rotating 2 objects 1 remains static problem opengl
Forum Updated to NodeBB v4.3 + New Features

Rotating 2 objects 1 remains static problem opengl

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • appollosputnikA Offline
    appollosputnikA Offline
    appollosputnik
    Banned
    wrote on last edited by
    #1

    I want to rotate 2 objects out of 3. One object should remain static. But it's not happening. Please help. I using glPushMatrix() and glPopMatrix() for the objects that I want to rotate.
    [code]
    void CopenGLCoordView::DrawScene(CDC *pDC)
    {
    wglMakeCurrent(pDC->m_hDC, m_hrc);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glEnable(GL_DEPTH_TEST);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    drawLine();

    glLoadIdentity();
    glPushMatrix();
    glRotatef(rot[0], 1.0f, 0.0f, 0.0f);
    glRotatef(rot[1], 0.0f, 1.0f, 0.0f);
    glRotatef(rot[2], 0.0f, 0.0f, 1.0f);
    drawAxes();
    glPrintX("X");
    glPrintY("Y");
    glPrintZ("Z");
    glPopMatrix();

    glFlush();
    SwapBuffers(pDC->m_hDC);
    wglMakeCurrent(NULL, NULL);
    }
    [/code]

    With the above code nothing is rotating. I want the drawLine() line should be static while the axis and x,y,z should rotate. Please help how can I achieve this?..Thanks Sujan

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This question is not Qt related, you should ask on "the opengl forum":http://www.opengl.org/discussion_boards/forum.php

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • appollosputnikA Offline
        appollosputnikA Offline
        appollosputnik
        Banned
        wrote on last edited by
        #3

        I am using this in Qt project. Yes it is openGL question.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          Violet Giraffe
          wrote on last edited by
          #4

          SGaist is right, this question is not Qt-related.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved