Changeset 1128 for GTP/trunk/App/Demos
- Timestamp:
- 07/12/06 17:40:05 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Geom
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Geom/Demo_LodStrips/main.cpp
r1114 r1128 211 211 lodfactorBefore=lodfactor; 212 212 213 if (lodfactor < 0.333f)213 /* if (lodfactor < 0.333f) 214 214 { 215 215 color.r=0.0; … … 232 232 } 233 233 } 234 mat[0]->setDiffuse(color); 234 mat[0]->setDiffuse(color);*/ 235 235 } 236 236 /* else … … 437 437 438 438 //Models 439 entity = mSceneMgr->createEntity(model_name, "../../../OgreStuff/media/GT/ bunnylod.mesh");439 entity = mSceneMgr->createEntity(model_name, "../../../OgreStuff/media/GT/ogrolod.mesh"); 440 440 441 441 ogreMesh = entity->getMesh().getPointer(); … … 443 443 // load LOD info from the object 444 444 meshloader=new Geometry::GeoMeshLoader; 445 Geometry::Mesh *themesh = meshloader->load("../../../OgreStuff/media/GT/ bunnylod.mesh");445 Geometry::Mesh *themesh = meshloader->load("../../../OgreStuff/media/GT/ogrolod.mesh"); 446 446 447 447 node = mSceneMgr->getRootSceneNode()->createChildSceneNode(); … … 464 464 465 465 // Colour-coded material 466 mat[0] = MaterialManager::getSingleton().create("test_mat",466 /* mat[0] = MaterialManager::getSingleton().create("test_mat", 467 467 ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 468 mat[0]->setCullingMode(CULL_ ANTICLOCKWISE);469 mat[0]->setAmbient(ColourValue(0. 3f,0.3f,0.3f));468 mat[0]->setCullingMode(CULL_NONE); 469 mat[0]->setAmbient(ColourValue(0.5f,0.5f,0.5f)); 470 470 mat[0]->setDiffuse(color); 471 mat[0]->setLightingEnabled(true); 472 entity->setMaterialName("test_mat"); 473 474 475 for (int i=-3; i<2; i++) // 20 476 for (int j=0; j<5; j++) // 20 471 mat[0]->setLightingEnabled(true);*/ 472 //entity->setMaterialName("test_mat"); 473 entity->setMaterialName("LODStripsDemo/Ogro"); 474 475 476 for (int i=-3; i<7; i++) // 20 477 for (int j=0; j<4; j++) // 20 477 478 { 478 479 char newObjName[16]=""; 479 480 sprintf(newObjName,"arbol_%d_%d",i,j); 480 481 Ogre::SceneNode * auxnode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); 481 auxnode->attachObject( entity->clone(newObjName) ); 482 auxnode->scale(0.8f,0.8f,0.8f); 482 Ogre::Entity *auxen = entity->clone(newObjName); 483 auxnode->attachObject(auxen); 484 auxnode->rotate(Ogre::Vector3(0,1,0),Ogre::Degree(180.0f),Ogre::Node::TS_WORLD); 485 auxnode->scale(30.0f,30.0f,30.0f); 483 486 float randomsepx = (float)((rand()%18)-9); 484 487 float randomsepy = (float)((rand()%12)-6); 485 auxnode->translate(i*100.0f+randomsepx,40.0f,-j*100.0f-randomsepx); 488 auxnode->translate(i*70.0f+randomsepx,-1.0f,-j*70.0f-randomsepx); 489 auxen->setNormaliseNormals(true); 486 490 } 487 491 -
GTP/trunk/App/Demos/Geom/OgreStuff/media/materials/scripts/Example.material
r1116 r1128 37 37 } 38 38 } 39 40 material LODStripsDemo/Ogro 41 { 42 technique 43 { 44 pass 45 { 46 ambient 0.8 0.8 0.8 47 cull_hardware none 48 49 texture_unit 50 { 51 texture player.jpg 52 } 53 } 54 } 55 } 56 57 39 58 material Examples/DarkMaterial 40 59 {
Note: See TracChangeset
for help on using the changeset viewer.