Archived

This topic is now archived and is closed to further replies.

Andy Reno

where's my mesh

Recommended Posts

I''ve created a single X file mesh to represent a room 60 * 40 meters. I have set the views at different values to try to get it central to how i made it. When it loads the scene is way out of view. Q: 1) Is there a method to set it to the perspective view i made it?, or any useful methods for similar? heres what im tryin Construction ... vFromPt = D3DXVECTOR3( 0.0f, 0.0f, -5.0f ); vLookAtPt = D3DXVECTOR3( 0.0f, 0.0f, 0.0f ); vUpVec = D3DXVECTOR3( 0.0f, 1.0f, 0.0f ); // vFromPt.z = -1550.0f; // works slightly better, but cant be right like this????????? ... /* ---------------------------My custom view Set up our view matrix. A view matrix can be defined given an eye point, a point to lookat, and a direction for which way is up. Here, we set the eye five units back along the z-axis and up three units, look at the origin, and define "up" to be in the y-direction. */ // modifying these params to navigate and find the mesh at runtime. void CAppForm::SetWorldView(D3DXVECTOR3 &vFromPt,D3DXVECTOR3&vLookAtPt,D3DXVECTOR3&vUpVec) { D3DXMATRIXA16 matView; D3DXMatrixLookAtLH( &matView, &vFromPt, &vLookAtPt,&vUpVec ); m_pD3DDevice->SetTransform( D3DTS_VIEW, &matView ); // Set the world matrix D3DXMATRIX matIdentity; D3DXMatrixIdentity( &matIdentity ); m_pD3DDevice->SetTransform( D3DTS_WORLD, &matIdentity ); } IT''''s Geeky

Share this post


Link to post
Share on other sites
Is the room just away from the origin?

If so, you need to change the world matrix to translate the room back to the origin if this is what you want.

Sounds like the room has been modelled at that distance away from the origin rather than around it.

Share this post


Link to post
Share on other sites