Mesh Vertex Coordinates
Hi There!
I´m trying to compute a mesh´s vertex coordinates to world space by looping through each vertex and transform coordinates. But I don´t seem to get it right.
When I try to transform each vertex into world space I always get the same position result for each vertex. What is wrong?
I know that the vertices in my mesh file doesn´t have the same positions.
for (unsigned int i = 0; i < size; i++)
{
pVertex = (D3DXVECTOR3*)vertdata; //Pointer to vertex
D3DXVECTOR3 vRayPos;
vRayPos.x = pVertex->x;
vRayPos.y = pVertex->y;
vRayPos.z = pVertex->z;
D3DXVec3TransformCoord(&vRayPos, &vRayPos, &m_CombinedMatrice); //Calculate Vertex Position in world coordinates.
vertdata += vertexbytesize; //Move Pointer to next vertex.
}
/Have A Nice Day -Patrick
[edited by - pebben on June 8, 2004 7:15:33 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement