视图空间设置有误导致物体无法显示
D3DXVECTOR3 look_position(0.0f,20.0f,50.0f);
D3DXVECTOR3 look_targetpoint(0.0f,0.0f,00.0f);
D3DXVECTOR3 look_worldup(0.0f,1.0f,0.0f);
D3DXMatrixLookAtLH(&lookAt,&look_position,&look_targetpoint,&look_worldup);
Device->SetTransform(D3DTS_VIEW,&lookAt);
这段代码是设置视图空间的标准写法,
需要注意的是look_position和look_worldup不能在一个直线上。否则渲染的物体将无法显示出来。
例如look_position(0.0f,20.0f,0.0f);这样设置就是错误的,因为它和 look_worldup(0.0f,1.0f,0.0f);处在一条直线上。