zoukankan      html  css  js  c++  java
  • Ogre 绘制基本图形

    ManualObject* lManualObject;
    
    lManualObject=mSceneMgr->createManualObject("mo");
    	lManualObject->begin("BaseWhiteNoLighting");
    	
    	Ogre::Real cm = -5.0 ;
    	Ogre::Real cp = 5.0;
    		
    	lManualObject->position(cm, cp, cm);// a vertex
    	lManualObject->colour(Ogre::ColourValue(0.0f,1.0f,0.0f,1.0f));
    	lManualObject->position(cp, cp, cm);// a vertex
    	lManualObject->colour(Ogre::ColourValue(1.0f,1.0f,0.0f,1.0f));
    	lManualObject->position(cp, cm, cm);// a vertex
    	lManualObject->colour(Ogre::ColourValue(1.0f,0.0f,0.0f,1.0f));
    	lManualObject->position(cm, cm, cm);// a vertex
    	lManualObject->colour(Ogre::ColourValue(0.0f,0.0f,0.0f,1.0f));
    
    	lManualObject->position(cm, cp, cp);// a vertex
    	lManualObject->colour(Ogre::ColourValue(0.0f,1.0f,1.0f,1.0f));
    	lManualObject->position(cp, cp, cp);// a vertex
    	lManualObject->colour(Ogre::ColourValue(1.0f,1.0f,1.0f,1.0f));
    	lManualObject->position(cp, cm, cp);// a vertex
    	lManualObject->colour(Ogre::ColourValue(1.0f,0.0f,1.0f,1.0f));
    	lManualObject->position(cm, cm, cp);// a vertex
    	lManualObject->colour(Ogre::ColourValue(0.0f,0.0f,1.0f,1.0f));
    
    		// face behind / front
    	lManualObject->triangle(0,1,2);
    	lManualObject->triangle(2,3,0);
    	lManualObject->triangle(4,6,5);
    	lManualObject->triangle(6,4,7);
    
    		// face top / down
    	lManualObject->triangle(0,4,5);
    	lManualObject->triangle(5,1,0);
    	lManualObject->triangle(2,6,7);
    	lManualObject->triangle(7,3,2);
    
    		// face left / right
    	lManualObject->triangle(0,7,4);
    	lManualObject->triangle(7,0,3);
    	lManualObject->triangle(1,5,6);
    	lManualObject->triangle(6,2,1);   
    	
    	lManualObject->end();
    
    
    	Ogre::String lNameOfTheMesh = "MeshCubeAndAxe";
    	lManualObject->convertToMesh(lNameOfTheMesh);
    
    	Entity* entity = mSceneMgr->createEntity(lNameOfTheMesh);
    
    	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(entity);

  • 相关阅读:
    学习asp.net比较完整的流程
    时间的获取和转换,C#和Sql
    学习一种新编程语言要做的10几个练习
    分布式网络管理优点总结
    点对点网络大解析
    如何阅读他人的程序代码
    WebConfig
    正则表达式30分钟入门教程
    程序员遇到BUG的解释
    在T-SQL语句中访问远程数据库(openrowset/opendatasource/openquery)
  • 原文地址:https://www.cnblogs.com/nafio/p/9137620.html
Copyright © 2011-2022 走看看