Skip to main content

Posts

Showing posts with the label Drawing coordinates system axes in corner of screen

Drawing coordinates system axes in corner of screen

Drawing coordinates system axes in corner of screen void CDEMView::DrawSomeBox() { // Define the needed matrices - object world, view and project D3DXMATRIX matObjectWorld; D3DXMatrixIdentity (&matObjectWorld); // object world matrix D3DXMATRIX matView; D3DXMatrixIdentity (&matView); // view matrix D3DXMATRIX matProjection; D3DXMatrixIdentity (&matProjection); // projection matrix // Get the needed matrices _device->GetTransform(D3DTS_VIEW, &matView); _device->GetTransform(D3DTS_PROJECTION, &matProjection); // Get the viewport D3DVIEWPORT9 viewport; _device->GetViewport(&viewport); // Get the center point of the object D3DXVECTOR3* p_centerPoint = BoxCenterVector; // this is from an external variable // Get the point on the creen that is the screen projection of the object D3DXVECTOR3 projectPoint; D3DXVec3Project(...