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. Anyone know how to get an object spinning on its own axis?

Anyone know how to get an object spinning on its own axis?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestionannouncementworkspace
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
    Alan Chambers
    wrote on last edited by
    #1

    Hi all, I have a straight forward problem for those who know anything about Direct3D and matrices. I have managed to setup the geometry pipeline and get my object (a cube) rotating around the world spaces origin (i.e. you can see it spinning around the camera view - it disappears out the left side of the screen and re-enters at the right, and keeps going). However, I would like it to spin on its own axis in front of the camera (not around the damn thing). I have setup the rotation (x,y and/or z), translation and scale matrix functions, but am unsure as to which ones I use? At the moment I am modifying the world_matrix because I want the actual object to spin and not the camera. My world matrix is the Identity matrix and in the UpdateFrame() function adds the rotationx evaluation before set the transform to that matrix and rendering it. Does this need to get set every frame update? or should I only set it once but do something else to the matrix to get it going? Urgent responses would be extremely appreciated (obviously). Cheers all, Alan. "When I left you I was but the learner, now I am the master" - Darth Vader

    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