actors and custom scene node

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
cosmo
Posts: 17
Joined: Sat May 06, 2017 1:29 pm

actors and custom scene node

Post by cosmo »

Hi,
sorry if my question may sound conceptually a little strange. By the way I need some additional information about how to implement a custom scene node.
I red the tutorial n.3 in the documentation section, but I'm a little messed up.
I hope I could briefly explain what I'm trying to accomplish.
I'm attempting to define two basic kind of scene node: one for rendering static objects, one another for animated models. In these two classes, I will also implement specific methods for material shading and for physicalization purpose.
But I'm stuck.
In the example n.3, it's only explained how to render the verteces for a simple shape like a tetraeder. Instead, I need to implement a custom scene node with much more polygons like, for example, a sphere or a barrel or even a character, all of which loaded from B3D file.
Is it possible in Irrlicht?
Or is it necessary to reprocess every single vertices of the mesh inside the custom scene node constructor?
Thanks for your support, kindly regards.
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: actors and custom scene node

Post by CuteAlien »

Simplest is probably looking at how Irrlicht implements it's CMeshSceneNode (check the .cpp file by the same name in source/Irrlicht).
You likely just need the OnRegisterSceneNode() and render() functions - if you have any questions about them just ask again here.
But in short: Load geometry into a mesh (most examples do that). And in your SceneNode draw it with driver->drawMeshBuffer.

Animated meshes are more tricky as it can depend on the animation format. Thought checking CAnimatedMeshSceneNode.cpp is probably the best way to get started.

Alternatively you should consider if you really need an own SceneNode. Or if if you instead use one of the already implemented scenenodes of Irrlicht which also allow material shading.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply