Impostors position and for small entities fix


14-05-2013 13:09:32


I had two problems with my impostors. Their positions weren't perfect and the png generated had no image for most of my entities ( probably cause they were too small i think ).

In ImpostorPage.cpp I changed the code in void ImpostorTexture::renderTextures(bool force) to this :
Ogre::SceneNode *n1= node->createChildSceneNode();
//n1->setPosition(-entityCenter + Vector3(10,0,10)); // EDITED
n1->setPosition(-entityCenter + Vector3(0,0,0));

Entity *e2 = entity->clone(entity->getName() + "_clone");
Ogre::SceneNode *n2= node->createChildSceneNode();
//n2->setPosition(-entityCenter + Vector3(10,0,10)); // EDITED
n2->setPosition(-entityCenter + Vector3(0,0,0));

This fixed both problems. My results :

Using batch page :

Same place but from farther with impostors :

Same view after I edited the code :
( notice you see bushes impostors now )

And about the png, here is the one for bushes ( the one given with pagedGeometry ) :
( yes it's all transparent )

After my edit :

And for the tree before :

and after :
( they are more centered )

Adding Vector3(10, 0, 10) was probably not here by mistake so I'm wondering what was its role ? Am I correct to change it or will it have an undesired effect ?


17-05-2013 11:59:13

The day after I made this topic I found this one on the main forum : [SOLVED] Paged Geometry Impostor Problem
It shows a better version of what I did based on Ogitor modifications.

Note : That topic from main forum should have been linked in this PagedGeometry section long time ago, some interested people could have missed it.