Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Rotating a single object out of 3 in OpenGL

Rotating a single object out of 3 in OpenGL

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsgame-dev
1 Posts 1 Posters 0 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.
  • A Offline
    A Offline
    appollosputnik
    wrote on last edited by
    #1

    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]

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups