Ignore:
Timestamp:
05/23/05 18:29:56 (19 years ago)
Author:
mattausch
Message:

start to add shadows to demo

Location:
trunk/VUT/work/TestCullingTerrain
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r108 r109  
    130130 
    131131        // if no objects file generate yourself 
    132         if (!mTerrainContentGenerator->LoadObjects("objects.out")) 
    133         { 
     132        //if (!mTerrainContentGenerator->LoadObjects("objects.out")) 
     133        //{ 
    134134                // the objects are generated on the whole terrain 
    135135                // height is restricted to 50, so no objects appear on peaks  
     
    138138                mTerrainContentGenerator->GenerateScene(1500, "robot"); 
    139139                //      mTerrainContentGenerator->GenerateScene(500, "ninja"); 
    140         } 
     140        //} 
    141141 
    142142        // no limitations needed anymore: the user can set  
    143143        // objects also on peaks of terrain 
    144144        mTerrainContentGenerator->SetMaxPos(Vector3(3000.0f, 5000.0f, 3000.0f)); 
     145 
     146        //-- create light 
     147        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); 
    145160} 
    146161//----------------------------------------------------------------------- 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h

    r107 r109  
    196196        Camera *mVizCamera; 
    197197        SceneNode *mCamNode; 
     198        Light *mSunLight; 
    198199        VisualizationRenderTargetListener *mRenderTargetListener; 
    199200 
Note: See TracChangeset for help on using the changeset viewer.