简单osg图形绘制.docVIP

  • 45
  • 0
  • 约4.77千字
  • 约 7页
  • 2016-08-24 发布于河南
  • 举报
简单osg图形绘制

使用vc++ 9.0建立简单的场景图形 一、创建vc++工程 打开vc++应用程序,在菜单栏中选择“文件”-“新建”-“项目”。出现新建项目对话框。在左侧的“项目类型”中,选择“Visual C++”-“win 32”,在右侧选择“win32 控制台应用程序”,在下面的“名称”编辑框内输入工程名,选择工程的位置,点击“确定”。如图所示: 在跳出的“win32 应用程序向导”中点击“完成”。 二、Osg源码的建立及分析 2.1 代码分析 此时生成的工程中,stdafx.h 、targetver.h、 stdafx.cpp均是vc++程序自己创建的,我们自己的代码的主函数则是写在工程名同名的cpp文件中。 例程:绘制直线 #include stdafx.h #include osg/Group #include osg/Geode #include osg/Geometry #include osgViewer/Viewer #include osg/PositionAttitudeTransform int _tmain(int argc, _TCHAR* argv[]) { 1 osg::ref_ptrosg::Group root = new osg::Group; 2 osg::ref_ptrosg::PositionAttitudeTransform pa1 =

文档评论(0)

1亿VIP精品文档

相关文档