c++ - Matrix muliply fails while creating the model view port transformation -


I am trying to get the current model view port transport. But when I try to multiplayer my phantom matrix with the vortex matrix, it fails but the matrix looks just fine. Unexpected exception on 0x00B4A67B in Project.exe: 0xC0000005: access violation location 0xFFFFFFFF Reading

xnamathmatrix.inl fails on line 239 >

  // Operate at the first line vX = _mm_mul_ps (vX, M2.r [0]);   

But both vx and MR.r look ok.

Take a look at the render method where this fails:

  zero firstscreen :: render () {if (m_d3dContext == 0) returns; Float blank chloror [4] = {0.0F, 0.0F, 0.25F, 1.0F}; m_d3dContext-> ClearRenderTargetView (m_backBufferTarget, clear collar); Unsigned int stride = sizeof (VertexPos); Unsigned int offset = 0; // Setup Inputlayout for Phantom remains how it is m_d3dContext-> IASetInputLayout (m_inputLayout); // Set Mistakes m_d3dContext-> IASetVertexBuffers (0, 1, and sprite.m_vertexBuffer, & long, and offset); m_d3dContext-> IASetPrimitiveTopology (D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); // Set Shader M_D3D Contex-> VSSetShader (m_vertexShader, 0, 0); m_d3dContext-> PSSetShader (m_pixelShader, 0, 0); // Set Shader Resource m_d3dContext- & gt; PSSetShaderResources (0, 1, and sprite.m_texture); m_d3dContext-> PSSetSamplers (0, 1, and sprite.m_sampler); // We add the perfect projection XMMATRIX world before we sprite.getWorldMatrix (); printMatrix (world); // print matrix print matrix (m_viewportMatrix); // Matrix XMMATRIX Model ViewPort = XMMatrixMultiply Print (world, m_viewportMatrix); // & lt; ---- The model fails to seePort = XMMatrixTranspose (modelViewPort); // Update resources m_d3dContext-> UpdateSubresource (m_modelViewPortBuffer, 0, 0, and Model ViewPort, 0, 0); m_d3dContext-> VSSetConstantBuffers (0, 1, & amp; m_modelViewPortBuffer); // sprite m_d3dContext-> Attract 6 Tops of Draw (6, 0); M_swapChain- & gt; Current (0, 0); }   

here m_viewportMatrix :

  bool FirstScreen :: createViewPortMatrix () {XMMATRIX view = XMMatrixIdentity () is created) ; XMMATRIX projection = XMMatrixOrthographicOffCenterLH (0.0f, std :: atof (m_config- & gt; getConfigValue ("width")), 0.0f, std :: atof (m_config-> getConfigValue ("height")), 0.1f, 100.0f); M_viewportMatrix = XMMatrixMultiply (see, projection); Back true; }   

And here is the method to obtain world metrics from Phantom:

  XMMATRIX CustomSprite :: getWorldMatrix () {XMMATRIX translate = XMMatrixTranslation (m_position .x) , m_position.y, 0.0f); XMMTRIX rotation = XMatrixRestationZ (M_Roopment); XMMATRIX scale = XMMatrixScaling (m_scale.x, m_scale.y, 1.0f); Return translation * rotation * scale; }   

If I run it then I get the following matrix, whish should be multiplied and the line inside the render should fail on the line:

  1 0 0 0 0 0 0 0 0 1 0 100 300 0 1   

and 0.001042 0 0 0 0 0.001389 0 0 0.010010 0 - 1 -1-

So what's going wrong here?

If necessary, I can upload the code anywhere to check incorrectly. (about 6cpp + h)


Update: If I create it with release settings then it is working but not in debug is. I'm sure there is nothing different in settings. It seems that is a part of the failure. I just checked the build settings and it works it changed back and it did not work. Really strange thing.

I had a very similar problem. Perhaps if you try something like this:

  XMMATRIX model ViewPort = ((XMMATRIX world) * ((XMMTRIX) m_viewportMatrix);   

This worked for me.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -