ming4883
08-01-2007 07:30:55
Dear all,
Since the PLSM had implement the CHC algorithm; I would like use it to display my urban scene,
however my screen appears blank after I enabled the CHC.
The following code is how I create the PLSM and how to enable CHC:
Then I add the buildings to the scene by creating SceneNodes and attaching entities to those SceneNodes.
i.e.
I am using the Ogre 1.2.4 and the PLSM plugin is built form the lastest source code in http://tuan.kuranes.free.fr/Ogre.html.
As I don't need the terrain, I just added the file "colors.material" to my resource path.
Am I did something wrong / have I miss something important in order to use the CHC in PLSM?
Thank you very much for your attentions and any answering.
Since the PLSM had implement the CHC algorithm; I would like use it to display my urban scene,
however my screen appears blank after I enabled the CHC.
The following code is how I create the PLSM and how to enable CHC:
mSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_EXTERIOR_REAL_FAR);
mCamera = mSceneMgr->createCamera("Default");
mViewport = mWindow->addViewport(mCamera);
mViewport->setBackgroundColour(Ogre::ColourValue(0.2f, 0.2f, 0.2f, 1.0f));
mCamera->setNearClipDistance(0.01f);
mCamera->setFarClipDistance(1000.0f);
mCamera->setAutoAspectRatio(true);
mCamera->setFOVy( Ogre::Radian(Ogre::Math::PI / 4.0f) );
mCamera->setPosition( Ogre::Vector3(0.0f, 10.0f, 10.0f) );
mCamera->lookAt( 0.0f, 10.0f, 0.0f );
// PLSM2 Init
Ogre::String cullMode("CHC");
bool cullDebug = true;
mSceneMgr->setWorldGeometry(""); // since I don't need terrain
mSceneMgr->setOption("CurrentOptionCamera", mCamera);
mSceneMgr->setOption("setCullingMode", &cullMode);
mSceneMgr->setOption("CullDebug", &cullDebug);
mSceneMgr->setOption("ShowPagingLandScapeOctree", &cullDebug);
Then I add the buildings to the scene by creating SceneNodes and attaching entities to those SceneNodes.
i.e.
Ogre::SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode("buildingA-01");
Ogre::Entity *ent = mSceneMgr->createEntity("buildingA.mesh");
node->attachObject(ent);
node->setPosition(0, 0, 0);
node->setOrientation(Ogre::Quaternion::IDENTITY);
I am using the Ogre 1.2.4 and the PLSM plugin is built form the lastest source code in http://tuan.kuranes.free.fr/Ogre.html.
As I don't need the terrain, I just added the file "colors.material" to my resource path.
Am I did something wrong / have I miss something important in order to use the CHC in PLSM?
Thank you very much for your attentions and any answering.