Hi,
Check this link:
http://www.gpwiki.org/index.php/Object_selection_lasso
hth :)
RTS Selection box in 3D, How?
Quote:http://www.gpwiki.org/index.php/Object_selection_lassoThe OP can correct me if I'm wrong, but I think his code is already based off that article.
Try using an identity matrix for the matWorld matrix;
D3DXMatrixIdentity(&matWorld);
And you need to use transformed coordinatres for comparison:
if( D3DXPlaneDotCoord( &plane
D3DXMatrixIdentity(&matWorld);
And you need to use transformed coordinatres for comparison:
if( D3DXPlaneDotCoord( &plane
, &D3DXVECTOR3( min.x, min.y, min.z ) ) >= 0.0f )
continue;
Those min/max values need to be transformed, since it's the bounding box of your object, simpply transform it by the matrix you used to render the object/unit.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement