Changeset 1590 for GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest/include
- Timestamp:
- 10/09/06 21:27:06 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest/include/DiffuseTest.h
r1525 r1590 44 44 45 45 { 46 this->mMoveSpeed = 2.0; 46 47 framecount = 0; 47 48 this->objectNode = objectNode; … … 52 53 { 53 54 objectNode->translate(0,0,0.5); 55 } 56 if (mInputDevice->isKeyDown(KC_MULTIPLY)) 57 { 58 objectNode->scale(1.1,1.1,1.1); 59 mTimeUntilNextToggle = 1; 60 } 61 if (mInputDevice->isKeyDown(KC_DIVIDE)) 62 { 63 objectNode->scale(1.0/1.1,1.0/1.1,1.0/1.1); 64 mTimeUntilNextToggle = 1; 54 65 } 55 66 if (mInputDevice->isKeyDown(KC_ADD)) … … 236 247 { 237 248 238 //createPostproc();249 // createPostproc(); 239 250 240 251 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); … … 245 256 Root::getSingleton()._setCurrentSceneManager(mSceneMgr); 246 257 247 mCamera->setPosition(0,10 0,240);258 mCamera->setPosition(0,10,10); 248 259 mCamera->setFOVy(Radian(Degree(80))); 249 //mCamera->setFarClipDistance(1000); 260 mCamera->setFarClipDistance(100); 261 mCamera->setNearClipDistance(0.1); 250 262 // Set ambient light 251 // mSceneMgr->setAmbientLight(ColourValue(1, 1, 1)); 263 mSceneMgr->setAmbientLight(ColourValue(0.1, 0.0537, 0.0)); 264 //mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0)); 265 252 266 253 267 // Skybox … … 256 270 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 257 271 258 Entity* object = mSceneMgr->createEntity("object", " ogrehead.mesh");272 Entity* object = mSceneMgr->createEntity("object", "athene.mesh"); 259 273 object->setMaterialName("GameTools/Diffuse/use"); 260 274 //object->setMaterialName("GameTools/Diffuse2"); 261 275 objectNode = rootNode->createChildSceneNode(); 262 276 objectNode->attachObject(object); 277 objectNode->scale(0.05,0.05,0.05); 278 objectNode->setPosition(0,4,0); 263 279 objectNode->_updateBounds(); 264 280 265 Entity* room = mSceneMgr->createEntity("atlascube", "atlascube.mesh"); 281 Entity* room = mSceneMgr->createEntity("atlascube", "diffscene.mesh"); 282 //room->setMaterialName("GameTools/Phong"); 266 283 SceneNode* roomNode = rootNode->createChildSceneNode(); 267 //roomNode->setScale( 2.5,2.5,2.5);284 //roomNode->setScale(10,10,10); 268 285 roomNode->attachObject(room); 269 286 roomNode->_updateBounds(); 270 271 287 288 Light* bluelight = mSceneMgr->createLight("BlueLight"); 289 bluelight->setType(Light::LT_POINT); 290 bluelight->setDiffuseColour(ColourValue(0.152,0.824, 1.0)); 291 //bluelight->setSpecularColour(ColourValue(0.152,0.824, 1.0)); 292 bluelight->setPowerScale(5.726); 293 bluelight->setAttenuation(12, 0, 1, 0); 294 SceneNode* bluelightNode = rootNode->createChildSceneNode(); 295 bluelightNode->setPosition(-5.948,9.619,0.980); 296 bluelightNode->attachObject(bluelight); 297 298 Light* walllight1 = mSceneMgr->createLight("WallLight1"); 299 walllight1->setType(Light::LT_POINT); 300 walllight1->setDiffuseColour(ColourValue(0.988,1.0, 0.808)); 301 //walllight1->setSpecularColour(ColourValue(0.988,1.0, 0.808)); 302 walllight1->setPowerScale(2.5); 303 walllight1->setAttenuation(12, 0, 1, 0); 304 SceneNode* walllight1Node = rootNode->createChildSceneNode(); 305 walllight1Node->setPosition(-4.822,9.353,-5.194); 306 walllight1Node->attachObject(walllight1); 307 308 Light* walllight2 = mSceneMgr->createLight("WallLight2"); 309 walllight2->setType(Light::LT_POINT); 310 walllight2->setDiffuseColour(ColourValue(0.988,1.0, 0.808)); 311 //walllight2->setSpecularColour(ColourValue(0.988,1.0, 0.808)); 312 walllight2->setPowerScale(2.5); 313 walllight2->setAttenuation(12, 0, 1, 0); 314 SceneNode* walllight2Node = rootNode->createChildSceneNode(); 315 walllight2Node->setPosition(-4.822,9.353,5.150); 316 walllight2Node->attachObject(walllight2); 317 318 Light* walllight3 = mSceneMgr->createLight("WallLight3"); 319 walllight3->setType(Light::LT_POINT); 320 walllight3->setDiffuseColour(ColourValue(0.988,1.0, 0.808)); 321 //walllight3->setSpecularColour(ColourValue(0.988,1.0, 0.808)); 322 walllight3->setPowerScale(2.5); 323 walllight3->setAttenuation(12, 0, 1, 0); 324 SceneNode* walllight3Node = rootNode->createChildSceneNode(); 325 walllight3Node->setPosition(-11.08,10.07,-24.658); 326 walllight3Node->attachObject(walllight3); 327 328 Light* walllight4 = mSceneMgr->createLight("WallLight4"); 329 walllight4->setType(Light::LT_POINT); 330 walllight4->setDiffuseColour(ColourValue(0.988,1.0, 0.808)); 331 //walllight4->setSpecularColour(ColourValue(0.988,1.0, 0.808)); 332 walllight4->setPowerScale(2.5); 333 walllight4->setAttenuation(12, 0, 1, 0); 334 SceneNode* walllight4Node = rootNode->createChildSceneNode(); 335 walllight4Node->setPosition(-11.08,10.07,-11.474); 336 walllight4Node->attachObject(walllight4); 337 338 Light* redlight1 = mSceneMgr->createLight("RedLight1"); 339 redlight1->setType(Light::LT_POINT); 340 redlight1->setDiffuseColour(ColourValue(1.0,0.367, 0.016)); 341 //redlight1->setSpecularColour(ColourValue(1.0,0.367, 0.016)); 342 redlight1->setPowerScale(3.59); 343 redlight1->setAttenuation(2, 0, 1, 0); 344 SceneNode* redlight1Node = rootNode->createChildSceneNode(); 345 redlight1Node->setPosition(24.958,7.743,-10.838); 346 redlight1Node->attachObject(redlight1); 347 348 Light* redlight2 = mSceneMgr->createLight("RedLight2"); 349 redlight2->setType(Light::LT_POINT); 350 redlight2->setDiffuseColour(ColourValue(1.0,0.367, 0.016)); 351 //redlight2->setSpecularColour(ColourValue(1.0,0.367, 0.016)); 352 redlight2->setPowerScale(3.59); 353 redlight2->setAttenuation(2, 0, 1, 0); 354 SceneNode* redlight2Node = rootNode->createChildSceneNode(); 355 redlight2Node->setPosition(18.689,7.743,-10.838); 356 redlight2Node->attachObject(redlight2); 357 272 358 OgreIlluminationManager::getSingleton().initTechniques(); 273 359 … … 302 388 objectNode 303 389 ); 390 mFrameListener->setPriority(1); 391 OgreIlluminationManager::getSingleton().setPriority(2); 304 392 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 305 393 mRoot->addFrameListener(mFrameListener);
Note: See TracChangeset
for help on using the changeset viewer.