Advertisement

How do I pass this view and projection matrix?

Started by September 24, 2018 03:19 AM
1 comment, last by TommyThree 6 years, 2 months ago

I'm using a library for gizmos (translate, rotate, scale) so that I can control my objects in a scene. I'm using this https://github.com/CedricGuillemet/ImGuizmo.

There is a function called Manipulate that takes const float* as the type for a projection and view matrix. also float* for a matrix. I have those Matrices stored in a dx11 XMMATRIX. How do I pass that data?


        DirectX::XMFLOAT4X4 change_mat(DirectX::XMMATRIX mat)
        {
            DirectX::XMFLOAT4X4 temp;
            DirectX::XMStoreFloat4x4(&temp, mat);

            return temp;
        }



		...


		DirectX::XMFLOAT4X4 v = change_mat(camView);
		DirectX::XMFLOAT4X4 p = change_mat(camProjection);
		DirectX::XMFLOAT4X4 w = change_mat(meshList[0].worldMat);

		ImGuizmo::SetRect(0, 0, io.DisplaySize.x,io.DisplaySize.y);
		ImGuizmo::Manipulate(&v.m[0][0], &p.m[0][0], mCurrentGizmoOperation, mCurrentGizmoMode, &w.m[0][0]);

 

This topic is closed to new replies.

Advertisement