开始学习OSG

#ifdef _DEBUG
#pragma comment(lib,"osgViewerd.lib")
#pragma comment(lib,"osgDBd.lib")
#pragma comment(lib,"OpenThreadsd.lib")
#pragma comment(lib,"osgd.lib")
#else
#pragma comment(lib,"osgViewer.lib")
#pragma comment(lib,"osgDB.lib")
#pragma comment(lib,"OpenThreads.lib")
#pragma comment(lib,"osgUtil.lib")
#pragma comment(lib,"osg.lib")
#endif

#include 
#include 
#include 
#include 
#include 

int main()
{
	osg::ref_ptr viewer = new osgViewer::Viewer;
	osg::ref_ptr gp= new osg::Group;
	osg::ref_ptr cowNode = osgDB::readNodeFile("cow.osg");
	gp->addChild(cowNode);
	osg::ref_ptr yaw= new osg::MatrixTransform;
	yaw->setMatrix(osg::Matrix::rotate(osg::DegreesToRadians(-45.0),0,1,0)*osg::Matrix::translate(0,0,3));
	yaw->addChild(cowNode);
	gp->addChild(yaw);
	viewer->setSceneData(gp);
	return viewer->run();

}


你可能感兴趣的:(OSG)