|
int _tmain(int argc, _TCHAR* argv[])
{
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer();
viewer->setSceneData(osgDB::readNodeFile("cow.osg"));
viewer->setCameraManipulator(NULL);
viewer->getCamera()->setViewMatrixAsLookAt(osg::Vec3d(0,0,0),osg::Vec3d(0,0,-1),osg::Vec3d(0,1,0));
viewer->getCamera()->setProjectionMatrixAsPerspective(40.0,1.0,1.0,100.0);
viewer->run();
return 0;
}
为什么这样的代码不能设置视角为从上往下观察牛? |
|