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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:03:14+00:00 2026-05-13T13:03:14+00:00

Suppose I have a simple WPF 3D scene set up with a single rectangle

  • 0

Suppose I have a simple WPF 3D scene set up with a single rectangle rotated -45 degrees around the X axis like so:

<Viewport3D>
    <Viewport3D.Camera>
        <PerspectiveCamera Position="0,0,4"/>
    </Viewport3D.Camera>
    <ModelVisual3D>
        <ModelVisual3D.Content>
            <DirectionalLight Color="White" Direction="-1,-1,-3" />
        </ModelVisual3D.Content>
    </ModelVisual3D>
    <ModelVisual3D>
        <ModelVisual3D.Content>
            <GeometryModel3D>
                <GeometryModel3D.Geometry>
                    <MeshGeometry3D Positions="-1,-1,0  1,-1,0  -1,1,0  1,1,0"
                                    TriangleIndices="0,1,2 1,3,2"/>
                </GeometryModel3D.Geometry>
                <GeometryModel3D.Material>
                    <DiffuseMaterial Brush="Red"/>
                </GeometryModel3D.Material>
            </GeometryModel3D>
        </ModelVisual3D.Content>
        <ModelVisual3D.Transform>
            <Transform3DGroup>
                <RotateTransform3D>
                    <RotateTransform3D.Rotation>
                        <AxisAngleRotation3D Axis="1,0,0" Angle="-45"/>
                    </RotateTransform3D.Rotation>
                </RotateTransform3D>
            </Transform3DGroup>
        </ModelVisual3D.Transform>
    </ModelVisual3D>
</Viewport3D>

This gives me the following:

rotated about X axis

Now I want to rotate the image 45 degrees around the model’s Z axis. If I just put a second RotateTransform3D in like so:

<RotateTransform3D>
    <RotateTransform3D.Rotation>
        <AxisAngleRotation3D Axis="0,0,1" Angle="45"/>
    </RotateTransform3D.Rotation>
</RotateTransform3D>

It rotates around the scene’s Z axis. For this particular X rotation I’ve worked out what I need is:

<RotateTransform3D>
    <RotateTransform3D.Rotation>
        <AxisAngleRotation3D Axis="0,1,1" Angle="45"/>
    </RotateTransform3D.Rotation>
</RotateTransform3D>

But here my maths fails me. Could anyone tell me how to work this out for an arbitrary rotation "A" (and "B" if you would like to)?

  • 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-13T13:03:15+00:00Added an answer on May 13, 2026 at 1:03 pm

    Ok, spoke to a mathematician friend and he gave me the answer:

    so i think what you need to do if
    you’re rotating around the vector
    (1,0,0) by an angle of ‘a’ (i.e rotating
    around the x-axis so transforming your
    object in the y-z plane).

    Further rotations are around

    x’ – (1,0,0) stays the same!

    y’ – (0,cosa,sina)

    z’ – (0,-sina,cosa)

    a similar principle will hold for
    rotations in the x-z plane (0,1,0)

    x’ – (-sina,0, cosa)

    y’ – (0,1,0) – the same

    z’ – (sina,o,cosa)

    and in the x-y plane around (0,0,1)

    x’ – (-sina,cosa,0)

    y’ – (cosa,sina,0)

    z’ – (0,0,1) stays the same

    TADA!

    UPDATE: I created a function to calculate a matrix which will rotate an object in all 3 axes. This can be used with a MatrixTransform3D.

        Matrix3D CalculateRotationMatrix(double x, double y, double z)
        {
            Matrix3D matrix = new Matrix3D();
    
            matrix.Rotate(new Quaternion(new Vector3D(1, 0, 0), x));
            matrix.Rotate(new Quaternion(new Vector3D(0, 1, 0) * matrix, y));
            matrix.Rotate(new Quaternion(new Vector3D(0, 0, 1) * matrix, z));
    
            return matrix;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 374k
  • Answers 374k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I don't know of any browser that lets you specify… May 14, 2026 at 8:05 pm
  • Editorial Team
    Editorial Team added an answer But you have identified the image ? If so, you… May 14, 2026 at 8:05 pm
  • Editorial Team
    Editorial Team added an answer Typically, you delete a branch after a merge. For example,… May 14, 2026 at 8:05 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.