Static billboard

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
tobix10
Posts: 15
Joined: Thu Feb 26, 2015 5:34 pm

Static billboard

Post by tobix10 »

Hi, I am writing simple demo for oculus and using IrrOculusVR project. I have custom node to draw a XYZ plot with some pixels in this space using driver-> draw3DLine, drawVertexPrimitiveList in render() method. Parent of this node is second scene manager which also handles events (rotation of axis, zoom in/out). Before connecting to oculus I used setViewPort to get realtime view of second scene in right bottom corner of screen. Now I created billboard and attached it to main scene manager. I am drawing second scene on render texture which is set as material for billboard.

Billboard is rotating with camera and has position in space, I don't want this. Also I don't want to mess up with setting viewport for eyes and doing it old way.
I want to do this as a part of main scene - some kind of node - but fix it to always show like 2D image in corner of screen. Is there a way to do that or some better solution?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Static billboard

Post by mongoose7 »

Just draw it. This is my code to draw the RT in the top left corner.

Code: Select all

    irr::core::recti srcrect  =  irr::core::recti(irr::core::vector2di(0, 0), rt->getSize());
    irr::core::recti destrect  = irr::core::recti(irr::core::vector2di(0, 0), irr::core::vector2di(
        (int) (rt->getSize().Width/16.0), (int) (rt->getSize().Height/16.0)));
    driver->draw2DImage(rt, destrect, srcrect);
tobix10
Posts: 15
Joined: Thu Feb 26, 2015 5:34 pm

Re: Static billboard

Post by tobix10 »

Yes, I can do that. For both eyes I call draw2DImage but in result I got three RGB lines instead of white :).

I am not quite sure about using videoDriver with oculus. What is in sceneManager is displayed ok (not mentioning lack of antialiasing which I turned on ;/), but as I said for draw2DImage white line is seen as rgb lines.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Static billboard

Post by mongoose7 »

Attach the billboard to the camera.
Post Reply