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 7067303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:11:08+00:00 2026-05-28T05:11:08+00:00

I have a model that has a bone which has a translated offset from

  • 0

I have a model that has a bone which has a translated offset from the parent bone (it is not positioned at the tail of the parent bone). In Blender, where the model was made, I can rotate the bone and see the attached mesh rotate correctly. However, when I attempt to rotate the bone in my code, it seems to rotate it about the tail of the parent. I’m messing something up in the Matrix math (my worst enemy).

Update:

protected override void Update(GameTime gameTime)
    {
        bone.Transform =  Matrix.CreateFromYawPitchRoll(0f, 0.5f, 0f);

        base.Update(gameTime);
    }

Pretty standard, but if it matters, Draw:

private void DrawModel(Model model, GraphicsDevice graphics, Matrix viewMatrix, Matrix projectionMatrix)
    {
        Matrix[] boneTransforms = new Matrix[model.Bones.Count];
        model.CopyAbsoluteBoneTransformsTo(boneTransforms);

        Matrix worldMatrix = orientation * Matrix.CreateTranslation(position);

        foreach (ModelMesh mesh in model.Meshes)
        {
            foreach (BasicEffect effect in mesh.Effects)
            {
                effect.World = boneTransforms[mesh.ParentBone.Index] * worldMatrix;
                effect.View = viewMatrix;
                effect.Projection = projectionMatrix;

                effect.EnableDefaultLighting();
                effect.PreferPerPixelLighting = true;

                // Set the fog to match the black background color
                effect.FogEnabled = true;
                effect.FogColor = Vector3.Zero;
                effect.FogStart = 1000;
                effect.FogEnd = 3200;
            }
            mesh.Draw();
        }
    }

Here’s screen shots to show the problem
http://s1231.photobucket.com/albums/ee516/Neovivacity/?action=view&current=boneRotation.png

  • 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-28T05:11:09+00:00Added an answer on May 28, 2026 at 5:11 am

    Ok, this may not be the most straightforward way of solving this, but I have a fix for anyone who’s also having a similar issue.

    When loading the Model, store the original transform. Then you multiply the bone’s transform like I did. Finally you get the original transforms Translation, oringalTranform.Translation for example, and get bone’s new transform. To adjust for the offset, bone.Transform *= Matrix.CreateTranslation(originalTranslation – newTranslation).

    Here’s a code snippet from my solution:

    public void LoadContent(ContentManager content)
        {
            Model = content.Load<Model>(ModelName);
            //Set the Bone pointers and transform matrices
            AileronLBone = Model.Bones["LAileron"];
            AileronRBone = Model.Bones["RAileron"];
            ElevatorBone = Model.Bones["Elevator"];
            RudderBone = Model.Bones["Rudder"];
            FlapsBone = Model.Bones["Flaps"];
            if (AileronLBone != null) AileronLTransform = AileronLBone.Transform;
            if (AileronRBone != null) AileronRTransform = AileronRBone.Transform;
            if (ElevatorBone != null) ElevatorTransform = ElevatorBone.Transform;
            if (RudderBone != null) RudderTransform = RudderBone.Transform;
            if (FlapsBone != null) FlapsTransform = FlapsBone.Transform;
        }
    
        public void Update(GameTime gameTime)
        {
            SetOffsetRotation(ElevatorBone, ElevatorTransform, ElevatorRotation);
        }
    
        public void SetOffsetRotation(ModelBone bone, Matrix transform, float rotation)
        {
            Vector3 oringalTrans = transform.Translation;
            bone.Transform *= Matrix.CreateRotationX(rotation);
            Vector3 newTrans = bone.Transform.Translation;
            bone.Transform *= Matrix.CreateTranslation(oringalTrans - newTrans);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a model that has a field, which originally defaulted to not
Pretty simple question. I have a model that has a property which is a
I have a model that has two fields, which I will call first_name and
I have a model that has a ForeignKey to the built-in user model in
I have a model that has an arbitrary number of children entities. For simplicity
Specifically, I have a model that has a field like this pub_date = models.DateField(date
I have a Person model that has a foreign key relationship to Book ,
[Updated a bit] I have a Task model that has a :completed boolean attribute.
I have a model of events that has various information such as date, location,
Say I have a model called User that has the following parameters: favorite_color, favorite_animal,

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.