osg define shape(create box)
#ifdef _WIN32
#include <Windows.h>
#endif // _WIN32 #include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/CompositeViewer>
#include <osgDB/ReadFile>
#include <osg/Geode>
#include <osg/Node>
#include <osgGA/TrackballManipulator>
#include <osg/GraphicsContext>
#include <osg/ShapeDrawable>
#include <osg/Material>
#include <osg/Image>
#include <osg/Texture2D>
#include <osg/TexEnv>
#include <osg/TexGen>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/AnimationPath>
#include <osg/Matrixd> #include <osgGA/GUIEventHandler>
#include <osgGA/CameraManipulator>
#include <osgGA/StandardManipulator>
#include <osgGA/OrbitManipulator>
#include <osgGA/TrackballManipulator> //创建盒子
osg::ref_ptr<osg::Geode> createBox()
{
osg::ref_ptr<osg::Geode> geode1 = new osg::Geode;
geode1->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0,0.0,0.0),10.0,8.0,6.0))); return geode1;
} int main()
{
osg::ref_ptr<osgViewer::Viewer> viewer1 = new osgViewer::Viewer;
osg::ref_ptr<osg::Group> group1 = new osg::Group;
group1->addChild(createBox()); viewer1->setSceneData(group1.get());
viewer1->setUpViewInWindow(, , , , ); return viewer1->run();
}
osg define shape(create box)的更多相关文章
- Virsh中创建虚拟机两种方式define和create的区别
本质上两者一样的,都是从xml配置文件创建虚拟机 define 丛xml配置文件创建主机但是不启动 create 同样是丛xml配置文件创建主机,但是可以指定很多选项,比如是否启动,是否连接控制台 ...
- OSG开源教程(转)
例:geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); 来指定要利用这些数据生成一个怎么样的形状. ...
- OSG学习:转动的小汽车示例
由于只是简单的示例,所以小汽车的模型也比较简单,是由简单的几何体组成. 代码如下: #include <osg\ShapeDrawable> #include <osg\Animat ...
- osg模型部分节点旋转
osg::ref_ptr<osg::Geode> CreateBox() { osg::ref_ptr<osg::Geode> geode = new osg::Geode; ...
- OSG入坑之路[转]
转载自:https://segmentfault.com/a/1190000010506374?utm_source=tag-newest osg插件原理:https://blog.csdn.net/ ...
- Learning OSG programing---osgShape
本例示范了osg中Shape ---- 基本几何元素的绘制过程.参照osg官方文档,Shape 类包含以下子类: 在示例程序中,函数createShapes函数用于生成需要绘制的几何形状. osg:: ...
- osg使用shader动态修改纹理坐标
#include <osg/Node> #include <osg/Geometry> #include <osg/Notify> #include <osg ...
- OSG绘制金字塔geode+动态纹理坐标
osg::Node* createPyramidModel() { // create the root node which will hold the model. osg::Group* roo ...
- 如何使用box2d做碰撞检测
cocos2dx3.0+vs2012编译通过. 主要是通过body->SetTransform来设置body的位置和角度,然后自己写个ContactListener来监听碰撞事件 源代码下载 # ...
随机推荐
- PYTHON 爬虫 baidu美女图片
from urllib import requestimport re import osdef main(): #page=request.urlopen("http://image.ba ...
- java基础(5)---内存分配
一.内存分配 如: 先写下面的源代码: 如果继续写:
- k8s的api
一.namespaced resources 所谓的namespaced resources,就是这个resource是从属于某个namespace的, 比如pod, deployment, serv ...
- 《hello--world团队》第四次作业:项目需求调研与分析
项目 内容 这个作业属于哪个课程 2016级计算机科学与工程学院软件工程(西北师范大学) 这个作业的要求在哪里 实验八 团队作业4:基于原型的团队项目需求调研与分析 团队名称 <hello--w ...
- JavaScript 廖2
HTML表单的输入控件主要有以下几种: 文本框,对应的<input type="text">,用于输入文本: 口令框,对应的<input type="p ...
- Selenium3学习中遇到的问题
pytesseract识别验证码 TesseractNotFoundError: tesseract is not installed or it's not in your path brew in ...
- Liunx使用
进入文件后的操作 1. vi打开文件后是命令模式状态,要用i或者a命令才可进入可编辑的状态哟. 2.在编辑模式的情况下敲完内容,这个时候就应该保存文件了. 保存文件要按esc,这样就会退回vi的命令模 ...
- 064_将 Linux 系统中 UID 大于等于 1000 的普通用户都删除
#!/bin/bash#先用 awk 提取所有 uid 大于等于 1000 的普通用户名称#再使用 for 循环逐个将每个用户删除即可 user=$(awk -F: '$3>=1000{prin ...
- Mokia 摩基亚
题目链接:[https://www.luogu.com.cn/problem/P4390] 快捷版题意: 维护一个\(W*W\)的矩阵,初始值均为\(S\).每次操作可以增加某格子的权值,或询问某子矩 ...
- P1899 魔法物品
题目描述 //又是一个好(nan)题好(nan)题 //首先,普通物品一开始就卖掉就可以,因为它不会增值 //至于魔法物品 //如果一个魔法物品使用了卷轴后的价值减去买卷轴的钱还不如鉴定前的价值高,那 ...