Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 965763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:03:00+00:00 2026-05-16T02:03:00+00:00

I’m a real noob who just started learning 3d programming and i have a

  • 0

I’m a real noob who just started learning 3d programming and i have a really hard time learning about rotation in 3D space. My problem is that I can’t seem to figure out how to rotate an object using it’s local coordinates.

I have a basic class for 3d objects and, for starters, i want to implement functions that will rotate the object on a certain axis with x degrees. So far i have the following:

 public void RollDeg(float angle)
    {
        this.rotation = Matrix4.Mult(rotation, 
            Matrix4.CreateRotationX(MyMath.Conversions.DegToRad(angle)));
    }

    public void PitchDeg(float angle)
    {
        this.rotation = Matrix4.Mult(rotation, 
             Matrix4.CreateRotationY(MyMath.Conversions.DegToRad(angle)));
    }

    public void YawDeg(float angle)
    {
        this.rotation = Matrix4.Mult(rotation,
             Matrix4.CreateRotationZ(MyMath.Conversions.DegToRad(angle)));
    }

‘rotation’ is a 4×4 matrix which starts as the identity matrix. Each time i want to roll/pitch/yaw the object, i call one of the functions above.

for drawing, i use another function that pushes a matrix onto the ModelView stack, multiplies it with the translation, rotation and scale matrices of the object (in this order) and begins drawing the vertices. ofcourse, finally i pop the matrix off the stack.

the problem is that the functions above rotate the object on the GLOBAL axis, not on the LOCAL ones, even if, from my understanding, every time you rotate an object, the local system changes it’s axis and then, when a new rotation is applyied on top of the others, the local axis are used for the new one.

i read different tutorials about the math behind it and how to rotate objects, but i couldn’t find one the could help me.

if anyone has the time, i would really appreciate if he could help me understand HOW to rotate around local axis and, maybe even more important, what i did wrong on my current implementation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:03:01+00:00Added an answer on May 16, 2026 at 2:03 am

    If you want to perform your transformations in this order : translation -> rotation -> scale (which makes perfectly sense, it’s what’s wanted usually), you have to multiply your matrices in the reverse order.

    In a right-handed coordinate system (i.e. the one openGL uses), matrix multiplication must be performed from right to left. This is why :

    ModelViewTransform = Transform * View * Model // <- you begin by the model, right ? so it’s this way

    Note that in directX they use a left-handed coordinate system. It has his shortcomings, but it’s more intuitive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.