Changeset 110 for trunk/VUT/work
- Timestamp:
- 05/24/05 07:21:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r109 r110 93 93 { 94 94 // Set ambient light 95 mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5)); 96 97 // Create a light 98 Light* l = mSceneMgr->createLight("MainLight"); 99 // Accept default settings: point light, white diffuse, just set position 100 // NB I could attach the light to a SceneNode if I wanted it to move automatically with 101 // other objects, but I don't 102 l->setPosition(20,80,50); 95 //mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5)); 96 mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0)); 97 98 //-- create light 99 mSunLight = mSceneMgr->createLight("MainLight"); 100 mSunLight->setType(Light::LT_POINT); 101 mSunLight->setPosition(-707, 4000, -500); 102 //mSunLight->setSpotlightRange(Degree(30), Degree(50)); 103 104 Vector3 dir; 105 dir = -mSunLight->getPosition(); 106 dir.normalise(); 107 mSunLight->setDirection(dir); 108 mSunLight->setDiffuseColour(0.8, 0.8, 0.8); 109 mSunLight->setSpecularColour(0.9, 0.9, 1); 110 111 //mSunLight->setCastShadows(true); 103 112 104 113 // --Fog … … 128 137 129 138 mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 130 139 131 140 // if no objects file generate yourself 132 //if (!mTerrainContentGenerator->LoadObjects("objects.out")) 133 //{ 134 // the objects are generated on the whole terrain 141 if (!mTerrainContentGenerator->LoadObjects("objects.out")) 142 { 135 143 // height is restricted to 50, so no objects appear on peaks 136 144 // => there is much occlusion 137 145 mTerrainContentGenerator->SetMaxPos(Vector3(3000.0f, 50.0f, 3000.0f)); 138 mTerrainContentGenerator->GenerateScene(1500, "robot"); 146 mTerrainContentGenerator->SetOffset(50); 147 148 // the objects are generated on the whole terrain 149 mTerrainContentGenerator->GenerateScene(1500, "athene"); 139 150 // mTerrainContentGenerator->GenerateScene(500, "ninja"); 140 //}151 } 141 152 142 153 // no limitations needed anymore: the user can set 143 154 // objects also on peaks of terrain 144 155 mTerrainContentGenerator->SetMaxPos(Vector3(3000.0f, 5000.0f, 3000.0f)); 145 146 //-- create light147 mSunLight = mSceneMgr->createLight("SunLight");148 mSunLight->setType(Light::LT_SPOTLIGHT);149 mSunLight->setPosition(1000,1250,500);150 mSunLight->setSpotlightRange(Degree(30), Degree(50));151 152 Vector3 dir;153 dir = -mSunLight->getPosition();154 dir.normalise();155 mSunLight->setDirection(dir);156 mSunLight->setDiffuseColour(0.35, 0.35, 0.38);157 mSunLight->setSpecularColour(0.9, 0.9, 1);158 159 mSunLight->setCastShadows(true);160 156 } 161 157 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.