Original Post
I'm a neophyte when it comes to DirectX, but I've been researching as much as I can because it interests the hell out of me. So I started a new basic project to become more familar with it and I've run into some trouble. I'm using two .X meshes, one is a plane and the other is a tiger I got from an example. When I load and render these two meshes, they work as expected--so there's no error there. The problem occurs when I attempt to translate either of these meshes. First let me post the code and then explain: I looked into this beforehand (that's how I found my way to this forum) and came across this topic: http://www.gamedev.net/community/forums/topic.asp?topic_id=377499 This was of some help, but apparently not enough. The variables t_x, t_y and t_z are floats with the value zero--so I'm not trying to even translate this anywhere yet, just get the code in order. If I comment out the first three lines of this function, it renders fine, but when I compile with them something strange happens. Instead of a plane and a tiger, I get two odd v-shaped brown things...I've no idea how to describe them because they're not exactly recognizable. Though I called them brown, there are lighter tan lines on them, still in the v-shaped direction. I'm sorry if any of this was unclear, but this is my first time posting here. Thanks in advance for any help. [Edited by - Pianka on June 8, 2006 9:13:58 PM]
void CMesh::objectRender( void ) {
D3DXMatrixIdentity(&m_matrix);
D3DXMatrixTranslation(&m_matrix, t_x, t_y, t_z);
this->getDevice()->SetTransform(D3DTS_WORLD, &m_matrix);
for (DWORD i = 0; i < m_dwNumMaterials; i++) {
this->getDevice()->SetMaterial(&m_pMeshMaterials);
this->getDevice()->SetTexture(0, m_pMeshTextures);
m_pMesh->DrawSubset( i );
}
}