Quote:D3DXVec3Unproject(&UnProjected, &Src, &V9, &gCamera->proj(), &gCamera->view(), &i);
Anddos, for one thing, your arguments are out of order. Src and V9 need to be reversed.
Quote:D3DXVec3Unproject(&UnProjected, &Src, &V9, &gCamera->proj(), &gCamera->view(), &i);
Quote:Original post by BuckeyeNot according to the docs? Did you miss the first parameter when looking at his code like I did the first time [smile]?
Anddos, for one thing, your arguments are out of order. Src and V9 need to be reversed.
Quote:Original post by AnddosAnd..?
This is what i am trying todo steve
Quote:Did you miss the first parameter when looking at his code like I did the first time [smile] ?
D3DXVECTOR3 RayPos(gCamera->mPosW.x,gCamera->mPosW.y,gCamera->mPosW.z); D3DXVECTOR3 RayDir(gCamera->mLookW.x,gCamera->mLookW.y,gCamera->mLookW.z);D3DCOLOR_XRGB(255,0,0))); D3DXVECTOR3 TransLook,TransNorml,TransPos; DWORD FaceIndex; BOOL Hit; D3DXMATRIX i; D3DXMatrixInverse(&i,NULL,&(bl2->BuildingWorld * gCamera->view())); D3DXVec3TransformCoord(&TransPos,&RayPos,&i); D3DXVec3TransformNormal(&TransLook,&RayDir,&i); D3DXVec3Normalize(&TransLook,&TransLook); D3DXIntersect(bl2->Mesh,&TransPos,&TransLook,&Hit,&FaceIndex,NULL,NULL,NULL,NULL,NULL); if(Hit) { MessageBox(NULL,"Hit","",0); }