Cant see trees


28-05-2010 01:41:24

After i extract the tree positions from the Ogitor produced .instance file, i use this method to load the trees, but they do not appear

SceneManager* mgr = SceneHandler::getSingleton().getSceneManager("Octree1");
String name = "Tree" + StringConverter::toString(mTreeInstanceIndex++);
Entity *myEntity = mgr->createEntity(name, "tree.07.mesh", "Custom");
treeLoader->addTree(myEntity, info.pos, Degree(info.yaw), info.scale);
LogManager::getSingleton().logMessage("[PGInstanceLoader] Created Tree '"
+ name + "'");

However if i create each tree as a separate entity (Without using PG), they come out fine. Im just worried that if i do it that way there will be significant performance loss with a render of thousands of trees


28-05-2010 01:46:50

You can try taking a look at the example applications that come with PG and compare to your code.

- Fish


28-05-2010 15:10:33

Ive done this and ive seen that most of them use the Tree2dLoader, but that seems to require the use of the HeightFunction, which attempts to set the worldFragmentType to WFT_SINGLE_INTERSECTION which is "Not supported"

EDIT* I solved the fragment error by changing sceneManagers, but i still cannot see the trees


30-05-2010 02:04:12

You're right but it's the same concept. Are you sure you are passing in the right Y height value?