void CTiny::ChooseNewLocation( D3DXVECTOR3* pV )
{
pV->x = ( float )( rand() % 256 ) / 256.f;
pV->y = 0.f;
pV->z = ( float )( rand() % 256 ) / 256.f;
}
so instead of using this i want to use my own which is take the mouse 2d point and turn it in to a 3d vector position ...
void CTiny::SetNewClickTarge(D3DXVECTOR3* pV)
{
GetCursorPos(&point);
src.x = (int)point.x;
src.z = (int)point.y;
DXUTGetD3D9Device()->GetTransform(D3DTS_VIEW,&viw);
DXUTGetD3D9Device()->GetTransform(D3DTS_PROJECTION,&prj);
DXUTGetD3D9Device()->GetTransform(D3DTS_WORLD,&wld);
//D3DXMatrixIdentity(&wld);
DXUTGetD3D9Device()->GetViewport(&v9);
D3DXVec3Unproject(&r,&src,&v9,&prj,&viw,&wld);
pV->x = r.x;
pV->y = r.y;
pV->z = r.z;
}
when i run the sample and tick control , and move the mouse around nothing seems to happen?