Original Post
Hi Im trying to render some text to the screen where an object apears in 3d space by using D3DXVec3Project() but im getting the wrong results:
base->D3dDevice->GetViewport(&vp);
D3DXVec3Project(&textPos,playerPosition,&vp,base->camera->getProjectionMatrix(),base->camera->getViewMatrix(),base->camera->getWorldMatrix());
sprintf(base->buffer,"CamDist: %f \n StrDist: %f \n FPS %d \n X %f Y %f Z %f",camDistance,storedDistace,base->getFPS(),textPos.x,textPos.y,textPos.z);
base->renderText(base->buffer,textPos.x,textPos.y,D3DCOLOR_XRGB(0,0,0));
test->setPosition(&textPos);
what could be wrong?