|
发表于 2009-7-9 08:33:38
|
显示全部楼层
要根据模型的包围球或者包围盒来计算,例如下面一段典型的代码:- double viewDistance = 2.0 * bs.radius();
- double znear = viewDistance - bs.radius();
- double zfar = viewDistance + bs.radius();
- float top = bs.radius();
- float right = bs.radius();
- camera->setProjectionMatrixAsOrtho( -right, right, -top, top, znear, zfar );
复制代码 |
|