Page 1 of 1

Custom rendering

Posted: Tue Mar 17, 2009 10:51 am
by _Bardor_
Hi, i hope i will get some help here.

In my game i use diffrent viewports.
One for the main window and another one for a inventory window.

In the main window i can draw easily scene nodes by calling smgr->drawall().
In my inventory window i have to draw single objects.
here are the steps i have made in the rundevice() loop:
1. change the viewport
2. set the active camera ( to inventory)
3. render the camera
4. make an object visible
5. render the object
6. make this object invisible again.

All objects are drawn in the inventory, but i still have two problems:

1. It seems render() doesn't take care of the rotation of the object. There is something missing which is included in smgr->drawall() which updates the rotation.
2. Additionally i want to use a lightscenenode in this inventory to light the objects. Somehow it doesn't work. Where in the sequence above do i have to render the light ? (before or after the camera/objects ?)
And what additional commands are needed to light the objects ?

Posted: Tue Mar 17, 2009 12:19 pm
by JP
The source for smgr->drawAll() is available to you so you could just look at how it's done ;)

Or you could use a secondary scenemanager for the objects in your inventory and call drawAll on that when you want them rendered

Posted: Wed Mar 18, 2009 4:57 am
by vitek
Would the CGUIViewport that I wrote a while ago work for you? It was originally written for Irrlicht 1.3 or so, but updating it should be fairly easy.

The CGUIViewport is just a standard IGUIElement that renders an Irrlicht scene in the space it covers. The scene could have a camera, lights, and all that stuff. You don't need to write any rendering code, just the code to initialize and configure and the CGUIViewport and then call gui->drawAll() just like you normally would.

Travis

Posted: Wed Mar 18, 2009 11:04 am
by _Bardor_
Thanks for the replies.

Using a second scene manager sounds easy i never thought of that.
And the class IGUIScenemanager does the same.

I'll try out the second scenemanager, because i have already a window with objects inside.