mamairaja
27-01-2011 05:42:33
Hello
Actually this is not exactly a paged geometry problem.
Just tried out paged geometry with ogre new terrain, For me hightfunction(took from example) seems to be a problem.
same code worked fine with ogre1.6
Problem : I could see that trees are placed at y=0 position.
So did I missed any? Here is my code(took from example)
Thanks
Actually this is not exactly a paged geometry problem.
Just tried out paged geometry with ogre new terrain, For me hightfunction(took from example) seems to be a problem.
same code worked fine with ogre1.6
Problem : I could see that trees are placed at y=0 position.
So did I missed any? Here is my code(took from example)
PagedGeometry* trees = new PagedGeometry();
trees->setCamera(mCamera );
trees->setPageSize(50);
trees->setInfinite();
trees->addDetailLevel<BatchPage>(150, 30);
trees->addDetailLevel<ImpostorPage>(600, 50);
TreeLoader2D *treeLoader = new TreeLoader2D(trees, TBounds(100, 100, 1400, 1400));
trees->setPageLoader(treeLoader);
HeightFunction::initialize(mSceneMgr);
treeLoader->setHeightFunction(&HeightFunction::getTerrainHeight);
Ogre::Radian yaw;
Ogre::Vector3 position = Ogre::Vector3::ZERO;
for (int i = 0; i < 2500; i++)
{
yaw = Degree(Ogre::Math::RangeRandom(0, 360));
scale = Ogre::Math::RangeRandom(0.07f, 0.4f);
position.x = Ogre::Math::RangeRandom(0, 1500);
position.z = Ogre::Math::RangeRandom(0, 1500);
treeLoader->addTree(treeEntitiy, position, yaw, 1);
}
Thanks