Hello
I am using the MovableText class to render 3D text. It worked fine until I tried to change the font size using setCharacterHeight(). For some reason the bounding box is wrong. I will have a look on the code and see if I can fix that. I guess it should be a simple fix once you understand how the bounding box is calculated. Could you please let me know if anyone noticed the problem and maybe already fixed it ? Thanks a lot
Eric
MovableText Bounding Box Problem
-
- Orc
- Posts: 419
- Joined: Thu Apr 07, 2005 2:11 pm
- Location: UK
-
- OGRE Retired Moderator
- Posts: 1365
- Joined: Tue Sep 07, 2004 12:43 pm
- Location: Aalborg, Denmark
Re: MovableText Bounding Box Problem
How is it wrong? Is it not updated with the change in font size (i.e. stays the same), or is it updated to some wrong size?manowar wrote:For some reason the bounding box is wrong.
I'm not familiar with the MovableText class, but maybe it's necessary to tell Ogre that an update is needed. See this thread.
-
- Orc
- Posts: 419
- Joined: Thu Apr 07, 2005 2:11 pm
- Location: UK
hello
Yes it is not updated. Here is my code when I create my scene
I tried to add nodeText->needUpdate() after that but it does not seem to change anything. Well anyway thanks for this really quick answer.
Eric
Yes it is not updated. Here is my code when I create my scene
Code: Select all
MovableText *mText = new MovableText("text","COOL TEXT !!!!!");
SceneNode* nodeText mgr->getRootSceneNode()->createChildSceneNode();
mText->setCharacterHeight(50);
nodeText->attachObject(mText);
nodeText->showBoundingBox(true);
Eric
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
How about 
Code: Select all
nodeText->getParentSceneNode()->needUpdate()

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Orc
- Posts: 419
- Joined: Thu Apr 07, 2005 2:11 pm
- Location: UK
-
- Orc
- Posts: 419
- Joined: Thu Apr 07, 2005 2:11 pm
- Location: UK
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
It's because the render loop hasn't started yet.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.