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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:18:42+00:00 2026-05-24T04:18:42+00:00

I have a simple IRenderable class that has members for position, scaling, and rotation:

  • 0

I have a simple IRenderable class that has members for position, scaling, and rotation:

XMFLOAT3 _position;
XMFLOAT3 _scaling;
XMVECTOR _rotation;

I am attempting to set them with the constructor. The first method here gives an access violation 0x00000000 trying to set _rotation (_position and _scaling are both set fine):

IRenderable() : _position(XMFLOAT3(0, 0, 0)), _scaling(XMFLOAT3(1, 1, 1)), _rotation(XMQuaternionIdentity()) { }

Making _rotation an XMVECTOR* instead and using _rotation(new XMVECTOR()) in the constructor sets it to an empty XMVECTOR, but then throws an access violation later when trying to set the identity Quaternion:

*_rotation = XMQuaternionIdentity();

Using the address of the XMQuaternionIdentity in the constructor works fine when creating the object,

IRenderable() : _position(new XMFLOAT3(0, 0, 0)), _scaling(new XMFLOAT3(1, 1, 1)), _rotation(&XMQuaternionIdentity()) { }

but then the quaternion itself contains garbage data by the time it needs to be used to render with. Both _position and _scaling are working fine in all of these situations.

What is the correct way to use XMVECTOR in this situation?

  • 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-24T04:18:42+00:00Added an answer on May 24, 2026 at 4:18 am

    To work around the bug Eitenne mentioned, I simply made an AxisAngle struct:

    struct AxisAngle {
        XMFLOAT3 Axis;
        float Angle;
    
        AxisAngle() : Axis(XMFLOAT3(0, 0, 0)), Angle(0) { }
    
        AxisAngle(XMFLOAT3 axis, float angle) {
            Axis = axis;
            Angle = angle;
        }
    };
    

    Using this in place of the XMVECTOR for rotation and then at render time just using the following to get the rotation matrix:

    XMMATRIX rotation = XMMatrixRotationNormal(XMLoadFloat3(&_rotation->Axis), _rotation->Angle);
    

    Obviously this is only a workaround and the real solution needs to be fixed in the compiler to allow the 16 bit boundaries on the heap for XMVECTOR.

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

Sidebar

Related Questions

I have simple aspx page that has a form and a input field in
I have simple base class with single static field. I have numerous classes that
I have simple remoting API that has method similar to this: bool FillMyList(List<string> ListToFill)
I have simple win service, that executes few tasks periodically. How should I pass
I have simple WinForms application where modifying Windows Registry. The problem is that in
i have simple QStandardItemModel that holds the date to show in QTreeview when i
I have simple html code that plays YouTube video after click on the image:
i have simple form that uploads image to server and returns php string containing
I have simple Entitly class with the @EmbeddedId ( Integer and String fields in
I have simple serial port program that is supposed to read the serial port

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.