当前位置: 首页 > news >正文

中核集团电子商城网页优化建议

中核集团电子商城,网页优化建议,做决定网站,seo超级外链发布自定义粒子系统示例(一) 自定义粒子系统示例(一)的代码如程序清单11-5所示#xff1a; /* 自定义粒子系统示例1 */ void particleSystem_11_5(const string strDataFolder) {osg::ref_ptrosgViewer::Viewer viewer new osgViewer::Viewer();osg::ref_ptros…自定义粒子系统示例(一) 自定义粒子系统示例(一)的代码如程序清单11-5所示 /* 自定义粒子系统示例1 */ void particleSystem_11_5(const string strDataFolder) {osg::ref_ptrosgViewer::Viewer viewer new osgViewer::Viewer();osg::ref_ptrosg::GraphicsContext::Traits traits new osg::GraphicsContext::Traits;traits-x 40;traits-y 40;traits-width 600;traits-height 480;traits-windowDecoration true;traits-doubleBuffer true;traits-sharedContext 0;osg::ref_ptrosg::GraphicsContext gc osg::GraphicsContext::createGraphicsContext(traits.get());osg::ref_ptrosg::Camera camera viewer-getCamera();camera-setGraphicsContext(gc.get());camera-setViewport(new osg::Viewport(0, 0, traits-width, traits-height));GLenum buffer traits-doubleBuffer ? GL_BACK : GL_FRONT;camera-setDrawBuffer(buffer);camera-setReadBuffer(buffer);osg::ref_ptrosg::Group root new osg::Group();// 自定义粒子系统加入场景root-addChild(createParticleScene(strDataFolder));// 优化场景数据osgUtil::Optimizer optimize;optimize.optimize(root.get());viewer-setSceneData(root.get());viewer-realize();viewer-run(); }// 创建自定义粒子系统 osg::ref_ptrosg::Group createParticleScene(const string strDataFolder) {osg::ref_ptrosg::Group root new osg::Group();// 创建粒子系统模板osgParticle::Particle ptemplate; ptemplate.setLifeTime(2);// 设置声明周期ptemplate.setSizeRange(osgParticle::rangef(0.75, 3.0));// 设置粒子大小变化范围 ptemplate.setAlphaRange(osgParticle::rangef(0.0, 1.0));// 设置粒子Alpha变化范围ptemplate.setColorRange(osgParticle::rangev4(osg::Vec4(1.0, 0.5, 0.3, 1.0),osg::Vec4(0.0, 0.7, 1.0, 0.0)));// 设置粒子颜色变化范围 ptemplate.setRadius(0.05);// 设置半径 ptemplate.setMass(0.05);// 设置重量// 创建粒子系统osg::ref_ptrosgParticle::ParticleSystem ps new osgParticle::ParticleSystem();string strClrPath strDataFolder Images\\smoke.rgb;ps-setDefaultAttributes(strClrPath, false, false);// 设置材质是否放射粒子是否添加光照 ps-setDefaultParticleTemplate(ptemplate);// 加入模板// 创建发射器和计数器调整每一帧增加的粒子的数目osg::ref_ptrosgParticle::RandomRateCounter counter new osgParticle::RandomRateCounter();counter-setRateRange(100.0,100.0);// 设置每秒增加的粒子的个数// 设置一个点放置器osg::ref_ptrosgParticle::PointPlacer placer new osgParticle::PointPlacer();placer-setCenter(osg::Vec3(0.0, 0.0, 0.0));// 设置位置// 创建弧度发射器osg::ref_ptrosgParticle::RadialShooter shooter new osgParticle::RadialShooter();shooter-setInitialSpeedRange(100, 0);// 设置发射器速度变化范围// 创建粒子放射器包括计数器、放射器和发射器osg::ref_ptrosgParticle::ModularEmitter emitter new osgParticle::ModularEmitter();emitter-setParticleSystem(ps.get());// 关联粒子系统emitter-setCounter(counter.get());// 关联计数器emitter-setPlacer(placer.get());// 关联点放置器emitter-setShooter(shooter.get());// 关联发射器root-addChild(emitter.get());// 加入场景// 创建重力模拟对象osg::ref_ptrosgParticle::AccelOperator ap new osgParticle::AccelOperator();ap-setToGravity(-1.0);// 设置重力加速度默认值为9.80665// 创建空气阻力模拟osg::ref_ptrosgParticle::FluidFrictionOperator ffo new osgParticle::FluidFrictionOperator(); // FluidViscosity为1.8e-5FluidDensity为1.2929ffo-setFluidToAir();// 设置空气属性// 创建标准编程器对象控制粒子在生命周期中的更新osg::ref_ptrosgParticle::ModularProgram program new osgParticle::ModularProgram();program-setParticleSystem(ps.get());// 关联粒子系统program-addOperator(ap.get());// 关联重力 program-addOperator(ffo.get());// 关联空气阻力root-addChild(program.get());// 添加到场景// 添加更新器实现每帧粒子的管理osg::ref_ptrosgParticle::ParticleSystemUpdater psu new osgParticle::ParticleSystemUpdater(); psu-addParticleSystem(ps.get());// 关联粒子系统osg::ref_ptrosg::Geode geode new osg::Geode;geode-addDrawable(ps.get()); root-addChild(geode.get());// 加入到场景中root-addChild(psu.get());return root.get(); } 运行程序截图如图11-7所示。 图11-7自定义粒子系统示例(一)截图
http://www.dnsts.com.cn/news/126843.html

相关文章:

  • 网站 建设ppt模板哪里可以检测短链脂肪酸
  • 常州网站优化昌邑市住房和建设局网站
  • 宠物电子商务网站建设方案一个网站的建设需要什么
  • 益阳网站建设哪里好重庆网站设计更新
  • 营销型网站建设公司方法和技巧免费网站有哪些
  • 抖音平台建站工具未来产品设计
  • 电商开发网站公司asp网站水印支除
  • 免费的模板下载宁波seo如何做推广平台
  • 购物网站中加减数目的怎么做快递加盟代理
  • 微信小程序 网站建设医院网站建设情况汇报
  • 成都城乡建设局官方网站可以看任何东西的浏览器
  • 网站建设服务 百度网店出售
  • 域名企业备案对网站的好处利用wix建手机网站
  • 南京有关制作网站的公司网站建设自己怎么做
  • 四川建设人才培训网站网站建设湛江
  • 自媒体网站源码模板dede苏州做网站的哪个公司比较好
  • 网站推广排名公司营销网络世界地图
  • 商务网站建设流程200字对对联的网站
  • 网站建设售后wordpress删除媒体库
  • sqlite做网站数据库对于公司网站建设的一些想法
  • 网站改版需要多久长春做网站优化
  • 济南市建设行政主管部门网站室内装修设计学校
  • 网站功能开发费用多少钱做招聘网站需要资质吗
  • 仿织梦小说网站源码wordpress启动命令
  • 网站设计大概价格wordpress 上传权限设置
  • 企业网站官网模板wordpress 和 shopify
  • 做网站有关机械的图片做网站需要实名认证吗
  • 衡水企业网站制作制作软件需要什么技术
  • 辽宁智能网站建设推荐上海企业网站建站
  • 学做窗帘要下载哪个网站深圳投资公司排名前十