随笔分类 -  OSG

摘要:更新回调(Update Callback)涉及到一个类:osg::NodeCallback。这个类重载了函数调用操作符。当回调动作发生时,将会执行这一操作符的内容。 如果节点绑定了更新回调函数,那么在每一帧系统遍历到此节点时,回调函数都会被调用。 下面给出一个例子:#include #inc... 阅读全文
posted @ 2015-06-09 11:06 Sawyer Ford 阅读(647) 评论(0) 推荐(0)
摘要:本文所有内容来自《OpenSceneGraph三维渲染引擎设计与实践》一书。 本文主要讨论的是OSG中节点的访问。 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accept()函数,将一个具体的访问器对象传递给节点。 第二步,节点反过来执行访问器的apply()函数,并将... 阅读全文
posted @ 2015-06-09 10:13 Sawyer Ford 阅读(2866) 评论(1) 推荐(0)
摘要:以下是一个简单的模型读取程序:#include #include #include void main(){ osgViewer::Viewer viewer; osg::Group *root = new osg::Group(); root->addChild(osgDB:... 阅读全文
posted @ 2015-05-25 17:35 Sawyer Ford 阅读(997) 评论(0) 推荐(0)
摘要:代码如下: //需要添加两个库:osgUtild.lib、osgTextd.lib#include #include #include #include #include #include #include #include #include #include #include #include ... 阅读全文
posted @ 2015-05-25 16:33 Sawyer Ford 阅读(837) 评论(0) 推荐(0)
摘要:直接上代码:#include #include #include #include #include #include #include #include #include #include void main(){ osgViewer::Viewer viewer; viewer.... 阅读全文
posted @ 2015-05-25 11:01 Sawyer Ford 阅读(863) 评论(0) 推荐(0)
摘要:现在为Hello World添加一些键盘响应事件。 //需要多添加两个库:osgGAd.lib、osgd.lib代码如下:#include #include #include #include void main(){ osgViewer::Viewer viewer; viewe... 阅读全文
posted @ 2015-05-22 11:05 Sawyer Ford 阅读(295) 评论(0) 推荐(0)
摘要:对于从未接触过OSG的我来说,首先需要一个入门教程。在OSG论坛逛了半天,再加上google,最终决定使用《OSG程序设计》这本书。 下面就贴出书中的第一个例子:Hello World。 使用vs2010新建一个win32控制台应用程序,然后配置一下osg环境,接下来就可以上代码了。 //... 阅读全文
posted @ 2015-05-22 10:04 Sawyer Ford 阅读(365) 评论(0) 推荐(0)
摘要:首先我想说的是,osg是有二进制安装包的:http://openscenegraph.alphapixel.com/osg/downloads/free-openscenegraph-binary-downloads(也不叫二进制安装包,就是别人预先编译好的)。我认为,如果只是简单的用下osg,... 阅读全文
posted @ 2015-05-19 20:29 Sawyer Ford 阅读(586) 评论(0) 推荐(0)