|
发表于 2004-7-1 22:57:00
|
显示全部楼层
Re:关于3D碰撞的问题
Transforming Rays
void TransformRay(d3d::Ray* ray, D3DXMATRIX* T)
{
// transform the ray's origin, w = 1.
D3DXVec3TransformCoord(
&ray->_origin,
&ray->_origin,
T);
// transform the ray's direction, w = 0.
D3DXVec3TransformNormal(
&ray->_direction,
&ray->_direction,
T);
// normalize the direction
D3DXVec3Normalize(&ray->_direction, &ray->_direction);
}
|
|