[Interest] Rotating a single object out of 3

Sujan Dasmahapatra sujan.dasmahapatra at gmail.com
Mon Mar 4 11:16:40 CET 2013


I have 3 objects on the screen, I want to rotate onll 2 objects the axis
and X,Y,Z. Another line is there which I want not to rotate. But with this
code below all are moving. Check below my DrawScene function.

[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_PROJECTION);
    glLoadIdentity();


    if (wd <= ht)
    glOrtho(left, right, top*ht/wd, bottom*ht/wd, znear, zfar);
    else
    glOrtho(left*wd/ht, right*wd/ht, top, bottom, znear, zfar);


    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);
    glCallList(axes);
    glPrintX("X");
    glPrintY("Y");
    glPrintZ("Z");
    glPopMatrix();

    drawLine();  //This is also moving...i want this to not to move...


    glFlush();
    SwapBuffers(pDC->m_hDC);

    wglMakeCurrent(NULL, NULL);
}

[/code]

-- 
Regards
Sujan
http://www.sujantechnologies.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130304/f43d0594/attachment.html>


More information about the Interest mailing list