[no bug] BillboardText and Parent

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

[no bug] BillboardText and Parent

Post by Acki »

Hi,
when I add a BillboardTextSceneNode as child of another SceneNode it ignores it's own position !!! :shock:
The BTSN is always at the center (pivot) of it's parent...

same for the TextSceneNode !!! :shock;[/b]
Last edited by Acki on Wed Dec 31, 2008 2:39 pm, edited 2 times in total.
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Unless someone's broken it since 1.4.2 it is working fine for me. The following testcase creates a reference node, a moving parent, and a moving child. If you watch, you'll notice that the parent moves around the origin in a circle, and the child moves in a small circle around its origin...

Code: Select all

#include <irrlicht.h> 
using namespace irr; 

int main() 
{ 
    // create device and exit if creation failed 

    IrrlichtDevice* device = createDevice(video::EDT_OPENGL); 

    if (device == 0) 
        return 1; // could not create selected driver.              

    video::IVideoDriver* driver = device->getVideoDriver(); 
    scene::ISceneManager* smgr = device->getSceneManager(); 
    gui::IGUIEnvironment* gui = device->getGUIEnvironment();

    // a point of reference, just sits at the origin
    scene::ISceneNode* ref = smgr->addCubeSceneNode(10.f);
    ref->setMaterialFlag(video::EMF_LIGHTING, false);
    ref->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));

    // a moving parent
    const core::dimension2df size(30.f, 30.f);
    const core::dimension2d<u32> count(10, 10);

    scene::IAnimatedMesh* terrain = smgr->addHillPlaneMesh("plane", size, count);

    scene::ISceneNode* tile = smgr->addMeshSceneNode(terrain->getMesh(0));
    tile->setMaterialFlag(video::EMF_LIGHTING, false);
    tile->setMaterialFlag(video::EMF_WIREFRAME, true);

    // a moving text scene node
    gui::IGUIFont* font = gui->getFont("../../media/fontcourier.bmp");
    if (!font)
        font = gui->getBuiltInFont();

    scene::ISceneNode* text =
        smgr->addBillboardTextSceneNode(font, L"Hello?", tile, core::dimension2d<f32>(50.f, 20.f));

    const core::vector3df center (0.f, 0.f, 0.f);

    scene::ISceneNodeAnimator* tile_animator = smgr->createFlyCircleAnimator(center, 60.f, 1 / 1000.f);
        tile->addAnimator(tile_animator);
    tile_animator->drop();

    scene::ISceneNodeAnimator* text_animator = smgr->createFlyCircleAnimator(center, 30.f, 4 / 1000.f);
        text->addAnimator(text_animator);
    text_animator->drop();

    scene::ICameraSceneNode* camera =
        smgr->addCameraSceneNode(0, core::vector3df(0.f, 140.f, -100.f), core::vector3df(0.f, 0.f, 0.f));

    while(device->run()) 
    { 
        if (driver->beginScene(true, true, video::SColor(255, 40, 40, 40)))
        {
            smgr->drawAll(); 
            driver->endScene(); 
        }
    } 

    device->drop(); 

    return 0; 
} 
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

OHHH, SORRY !!!
my bad, the parent was scaled Y = 0 :oops:

so if an admin would be so kind and removes this... :P
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Thanks, Travis. That Works For Me as well with 1.5 and the SVN trunk.

Acki, can you provide a SVN/ SDK version and sample code that demonstrates the problem?

Heh, just saw your update. I'm going to leave this open, as a lesson in why providing a test case is always a good idea. ;)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

:rofl: ok :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply