- 博客(36)
- 资源 (2)
- 收藏
- 关注
原创 Ogre灯光
Ogre定义的三种灯光类型及使用1. LT_POINT = 0,//点光源Point light sources give off light equallyin all directions, so require only position not directionlight = mSceneMgr->createLight("pointLight");light->set
2017-08-09 13:58:37
462
原创 Ogre 常用设置
1.跳过ogre配置窗口:restoreConfig()bool configure(void){ if(mRoot->restoreConfig() || mRoot->showConfigDialog()) //if(mRoot->showConfigDialog()) { mWindow = mRoot->initialise(true, OGRE_WIN_TITLE);
2017-06-08 09:48:59
342
原创 ogre 世界坐标、本地坐标、屏幕坐标之间的转换
1.本地坐标转为世界坐标void local2World(const Vector3 locP, Vector3 &worldP, const SceneNode* node){ Matrix4 worldMat; node->getWorldTransforms(&worldMat); //获取该物体的世界坐标矩阵 worldP = worldMat * locP;}2.世
2017-06-06 17:19:25
1786
原创 Ogre传入数组到cg程序中
1.material文件定义shader 参数:param_named arr custom2.cg文件定义数组参数:uniform float4 arr注意:cg中必须使用传入的数组,否则会报错。3.主程序中更新数组信息float m_arr[10][4];Ogre::MaterialPtr mat = Ogre::MaterialManager::getSin
2017-05-19 18:07:16
502
原创 如何解决应用程序无法启动,因为应用程序的并行配置不正确?
当遇到应用程序打不开时,提示报错“应用程序无法启动,因为应用程序的并行配置不正确”,该类问题大部分原因为缺少c++运行库。解决方法:利用sxstrace跟踪调试应用程序运行时需要的动态库的版本和路径。步骤:1.利用管理员身份运行命令提示窗口2.输入sxstrace.exe Trace -logfile:C:\trace.log(路径自定义),开始跟踪3.运行应用程序
2017-05-10 17:11:51
15680
4
原创 Ogre 绘制立方体
void createCube(){ //1.创建Mesh对象 MeshPtr msh = MeshManager::getSingleton().createManual("Cube", "General"); SubMesh* sub1 = msh->createSubMesh("1"); //2.定义顶点数量、信息 const float sqrt13
2017-04-25 17:32:07
818
原创 迷宫-最短路径距离-BFS
已知条件:迷宫地图:0-不通,1通二维数组(N*M)0 0 0 0 0 0 0 00 1 1 0 0 1 0 00 0 1 1 1 1 0 00 1 1 1 0 1 1 11 1 1 0 0 0 0 1起始点:s(2,2)求解所有可通过的点到起始点的最短距离。算法:#include #include #include #include
2017-04-21 17:14:41
548
原创 Ogre 获取显示鼠标位置
1. 鼠标纹理贴图2. 鼠标材质脚本material mouse{ technique { pass { scene_blend alpha_blend depth_check off texture_unit { tex_address_mode clamp texture mouse.png } } }}
2017-04-21 16:49:07
758
原创 c++ 文件存取
一、将数据写入文件void writeToFile(){ std::ofstream outfile; outfile.open("data.txt"); //创建、打开文件 for(unsigned int x = 0; x < N; x++) { for(unsigned int y = 0; y < M; y++) { outfile<<data[x * N
2017-04-21 16:42:06
2230
原创 Window串口相关API
3 WindowsSerial Port API3.1 相关API3.1.1 CreateFile1. 功能:打开串口2. 原型: HANDLECreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess,
2017-04-18 17:19:44
574
原创 Ogre 利用 pixel buffer 绘制纹理
1.Ogre相关类(1)HardwarePixelBuffer类(2)PixelBox类A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.In case of a rectangle, depth must be 1. Pixels are stor
2017-04-12 17:25:18
526
转载 Delaunay三角剖分算法
一、相关定义【定义】三角剖分:假设V是二维实数域上的有限点集,边e是由点集中的点作为端点构成的封闭线段, E为e的集合。那么该点集V的一个三角剖分T=(V,E)是一个平面图G,该平面图满足条件:1.除了端点,平面图中的边不包含点集中的任何点。2.没有相交边。3.平面图中所有的面都是三角面,且所有三角面的合集是散点集V的凸包。在实际中运用的最多的三角剖分是Delaunay三角剖分
2017-04-12 16:59:11
1955
原创 Ogre 创建天空盒、天空穹、天空面
1.天空盒(立方体)六面:stevecube_up,stevecube_dn,stevecube_lf,stevecube_rt,stevecube_fr,stevecube_bk.jpg创建:mSceneMgr->setSkeBox(是否启用,材质名,skybox与camera的距离,渲染级别) mSceneMgr->setSkyBox(true,"Exampl
2017-04-07 17:41:56
1433
原创 包围球的计算
//【Ritter90】逼近包围球的计算----------------------------------------------------------------------//查找相隔最远的两个顶点void MostSeparatedPointsOnAABB(int &imin, int &imax, Vector3 pt[], int numPts){ int minx = 0,
2017-03-23 17:02:11
878
原创 C++ 串口通信
串口基类SerialClass.h#ifndef SERIALCLASS_H_INCLUDED#define SERIALCLASS_H_INCLUDED#define ARDUINO_WAIT_TIME 2000#include #include #include class Serial{private: //Serial comm handler HAN
2017-03-21 17:24:17
892
原创 Ogre中获取mesh顶点数据
void getMeshInfo(Entity* ent) { MeshPtr mesh = ent->getMesh(); bool added_shared = false; size_t current_offset = 0; size_t shared_offset = 0; size_t index_offset = 0; size_t next_o
2017-03-20 16:55:25
889
原创 Ogre中绘制平面
利用Ogre自带的Plane类绘制平面//1.定义平面对象Plane plane;//2.设置相关属性plane.normal =Vector3(0,-1,1);//法向量plane.d = 0;//与世界原点的距离 //3.创建MeshMeshManager::getSingleton().createPlane("平面的名字","所属的资源组", "平面对象", "平
2017-03-17 17:21:00
611
原创 Ogre中场景查询和碰撞检测
Ogre中场景查询相关类基类SceneQuery、其子类RegionSceneQuery区域查询、RaySceneQuery射线查询、IntersectionSceneQuery相交查询每种场景查询都有对应的SceneQueryResult和SceneQueryListener查询结果分为场景中可移动的物体元素(MovableObject)和世界信息(复杂场景中的地形等不变的元素)
2017-03-16 17:05:58
670
原创 Ogre中实现动画效果之节点动画(Node Animation)
Ogre中与节点动画相关的类:(1)Ogre::Animation(2)Ogre::AnimationState(3)Ogre::NodeAnimationTrack(4)Ogre::TransformKeyFrame节点动画的使用步骤://1.创建动画对象Animation* anim= mSceneMgr->create
2017-03-15 17:32:06
1367
原创 UIViewController的生命周期
一、初始化顺序1.alloc: 创建ViewController对象,分配空间2.init(initWithNibName):初始化ViewController本身3.loadView: 当view需要被展示而它却是nil时,viewController会调用该方法。不要直接调用该方法。如果手工维护views,必须重载重写该方法;如果使用IB维护views,
2016-08-12 16:51:30
262
原创 IOS之UITableView优化-可重用机制
一、UITableViewCell的可重用机制目的:为了做到显示和数据分离, 通过重用单元格来达到节省内存的目的1.使用可重用机制创建cell(系统)1)定义可重用标识2)从可重用队列中取出cell3)若队列中无可用cell,利用alloc,init新建cellstatic NSString *reuseIndentifier = @"MyCell";
2016-08-12 16:16:12
1009
原创 IOS之SQLite
SQLite的使用:1.添加相关库libsqlite3.tdbbuid phases - > link binary with libraries -> 点击"+" ->搜索libsqlite3.tdb并添加2.基本步骤1)创建数据库- (void)openDB{ // 生成存放在沙盒中的数据库完整路径 NSString *docDir = NS
2016-08-11 21:20:33
252
Focus on Scientific Visualization
2017-12-20
java期中卷
2016-03-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人