资源简介
OpenSceneGraph三维渲染引擎设计与实践一书的源码,造福社区 0积分下载. 冲鸭程序员们,源码亲测可用,希望给个好评
代码片段和文件信息
/* -*-c++-*- Copyright (C) 2009 Wang Rui
* OpenSceneGraph Engine Book - Design and Implementation
* How to create a billboard forest
*/
#include
#include
#include
#include
#define RAND(min max) ((min) + (double)rand()/(RAND_MAX+1)*((max)-(min)))
void createTrees( osg::Billboard& root )
{
root.getOrCreateStateSet()->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
root.getOrCreateStateSet()->setMode( GL_LIGHTING osg::StateAttribute::OFF );
osg::ref_ptr texture = new osg::Texture2D( osgDB::readImageFile(“tree.rgba“) );
for ( unsigned int i=0; i<200; ++i )
{
osg::ref_ptr tree =
osg::createTexturedQuadGeometry( osg::Vec3(000) osg::Vec3(RAND(0.51.5)00) osg::Vec3(00RAND(1.02.0)) );
tree->getOrCreateStateSet()->setTextureAttributeAndModes( 0 texture.get() );
root.addDrawable( tree.get() osg::Vec3(RAND(-1010) RAND(-1010) 0.0) );
}
}
int main( int argc char** argv )
{
osg::ref_ptr treeGeode = new osg::Billboard;
treeGeode->setMode( osg::Billboard::POINT_ROT_EYE );
createTrees( *treeGeode );
osgViewer::Viewer viewer;
viewer.setSceneData( treeGeode.get() );
return viewer.run();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 1399 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\billboard\billboard.cpp
....... 571 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\billboard\CMakeLists.txt
....... 1523 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\birdseye\birdseye.cpp
....... 640 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\birdseye\CMakeLists.txt
....... 1272 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\bitmap\bitmap.cpp
....... 640 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\bitmap\CMakeLists.txt
....... 2078 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\callback\callback.cpp
....... 642 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\callback\CMakeLists.txt
....... 2442 2009-11-22 08:56 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeLists.txt
....... 2173 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\CustomModules.cmake
....... 4182 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindOpenGL.cmake
....... 1634 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\Findosg.cmake
....... 1596 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgAnimation.cmake
....... 1505 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgDB.cmake
....... 1501 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgFX.cmake
....... 1513 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgGA.cmake
....... 1685 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgIntrospection.cmake
....... 1661 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgManipulator.cmake
....... 1595 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgParticle.cmake
....... 1565 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgShadow.cmake
....... 1513 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgSim.cmake
....... 1571 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgTerrain.cmake
....... 1511 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgText.cmake
....... 1521 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgUtil.cmake
....... 1551 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgViewer.cmake
....... 1551 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgVolume.cmake
....... 1602 2009-09-22 00:13 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\CMakeModules\FindosgWidget.cmake
....... 5437 2009-11-22 08:41 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\data\0.JPG
....... 3343 2009-11-22 08:41 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\data\1.JPG
....... 5681 2009-11-22 08:41 OpenSceneGraph三维渲染引擎设计与实践_source\Examples\data\2.JPG
............此处省略138个文件信息
- 上一篇:SPRacingF3飞控官方教程中文版
- 下一篇:QrCode.rar
相关资源
- WebRTC噪声抑制算法源码
- 源码
- 黑太阳1.0远控源码
- tcpip详解卷2实现 源码
- indy10.0.52_source
- md5加密算法源码
- 视频监控分屏效果源码
- 《Linux+C编程从初学到精通》源码和实
- Sysinternals_Source.zip
- 079登陆器源码.rar
- 企业进销存管理系统 信息化管理软件
- 用openGL实现的3D国际象棋游戏源码
- 外卖小程序源码及后台有数据库,附
- 微信小程序星巴克咖啡源码
- Delphi7海康硬盘录像机或摄像头客户端
- 网上选课系统需求分析+4+1视图+源代码
- 微信最新原版跳一跳小程序源码
- 收集的图像分割源码(一个模型有多
- 《电力电子、电机控制系统的建模和
- 冒险岛外网登录器带源码
- CS透视源码
- 微信小程序-商城源码+后台数据库
- polarssl-1.3.15源码
- 1000个病毒源码请斟酌后
- 基于GPU光线投射的体绘制算法源码(
- 用Qt写俄罗斯方块游戏的教程和源码
- 精通D3.js书籍源码
- 邓俊辉 数据结构 source code
- Opengl写的摩天轮源码
- APS学生选课系统完整源码
评论
共有 条评论