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

  • Home
  • SEARCH
  • 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 8846247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:56:04+00:00 2026-06-14T11:56:04+00:00

I just need to rotate a model 90 degrees when it starts, without editing

  • 0

I just need to rotate a model 90 degrees when it starts, without editing its local axis.
I have a missile flying 90 degrees sideways down a tunnel, and I need it to be facing down the tunnel while still retaining its movement directions. I’ve tried:

virtual public void setOrientationWorld(float x, float y, float z)
{
    mOrientation *= Matrix.CreateRotationX(MathHelper.ToRadians(x));
    mOrientation *= Matrix.CreateRotationY(MathHelper.ToRadians(y));
    mOrientation *= Matrix.CreateRotationZ(MathHelper.ToRadians(z));
}

setOrientationWorld(0, -90, 0);

And I’ve tried:

virtual public void setOrientationLocal(float x, float y, float z)
{                                                                  
    mOrientation *= Matrix.CreateFromAxisAngle(mOrientation.Right, MathHelper.ToRadians(x));
    mOrientation *= Matrix.CreateFromAxisAngle(mOrientation.Up, MathHelper.ToRadians(y));
    mOrientation *= Matrix.CreateFromAxisAngle(mOrientation.Forward, MathHelper.ToRadians(z));
}

setOrientationLocal(0, -90, 0);

But they both ruin everything. When I do either, the missile rotates, and all the axis’s change. Even just going setPosition(0,0,-1) makes it move along the worlds X axis instead of it’s Z.

I have tried moving the missile both locally and globally, but to no avail, like this:

virtual public void moveLocal(float x, float y, float z)
{
    mPosition += mOrientation.Right * x;
    mPosition += mOrientation.Up * y;
    mPosition += mOrientation.Forward * z;
}

And

virtual public void moveWorld(float x, float y, float z)
{
    mPosition.X += x;
    mPosition.Y += y;
    mPosition.Z += z;
}

The only other relevant thing I can think of is the draw function, which may have something to do with it:

        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.EnableDefaultLighting();
            effect.World = Matrix.Identity *
                Matrix.CreateScale(mScale) *
                transforms[mesh.ParentBone.Index] *
                Matrix.CreateTranslation(mPosition) *
                mOrientation;
            effect.View = game1.getView();
            effect.Projection = game1.getProjection();
        }

Pls Halp!

  • 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-06-14T11:56:05+00:00Added an answer on June 14, 2026 at 11:56 am

    The order you apply the translation and rotation is important. If you are applying the rotation globally then translating first will cause problems as you are moving the object away from it’s centre of rotation. In that case you need to rotate and then translate.

    When applying the rotations in the local space of the missile, the order you apply the rotations is important too. Applying them in the order “Roll”, “Pitch”, “Yaw” will produce a different result to applying them in the order “Pitch”, “Yaw”, “Roll” and so on for all six combinations. The order is dependent on what you are trying to achieve so you may have to create a method that can do all six and selects which one based on a parameter.

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

Sidebar

Related Questions

I need to rotate a 2d sprite about the y axis. E.g., I have
I have a gesture recignizer, and I need to rotate a body: - (void)
Imagine you have two points in 2d space and you need to rotate one
I am creating a responsive website, and have just noticed a strange behaviour in
I have been trying to figure out how to rotate videos with FFmpeg. I
I have an iPad app that I would like to work in the sideways
I need to rotate png images (some circle disks). It is done with some
I have a cube in my OpenGL view which I can rotate when I
I need create a 3D model of and animate a robotic arm. The arm
I'm developing in MonoTouch and I have an issue where a 3D model should

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.