GuiScene

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
Der Walden
Posts: 7
Joined: Fri Jul 20, 2012 2:12 pm

GuiScene

Post by Der Walden »

Helly Guys, here is a nice Little Code-snippet i have created called GuiScene...
It is an Complete SceneManager inside an IGUIElement.
It is designed to be a easy Mesh-Showcase for the Irrlicht-GuiSystem.
It allso supports rotating the viewed Mesh using the Mouse.

To show it in Action i have created a Demo based on the original Irrlicht-Demo "05.UserInterface".
Just Click the "New Window"-Button in the Demo and Play around with it... :wink:

Here is a Screenshot of it in Action and The Demo + Source as Download...
Image
http://derwalden.de.funpic.de/Irrlicht/ ... neDemo.zip
ledgarl
Posts: 30
Joined: Wed Oct 25, 2006 1:58 pm
Location: Bogota,Colombia

Re: GuiScene

Post by ledgarl »

cool!
look nice :)
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: GuiScene

Post by Granyte »

it seem very nice but sadly it's a little to limited as it's built around rendering a single mesh
Der Walden
Posts: 7
Joined: Fri Jul 20, 2012 2:12 pm

Re: GuiScene

Post by Der Walden »

No its not limited to render just a single mesh...

Just take a look to the GUIScene.h and you will see this functions:

Code: Select all

 
        ISceneManager *GetScene(void);
        ICameraSceneNode *GetCamera(void);
        void SetOptimalCamDistToNode (ISceneNode *aNode);
 
        IAnimatedMeshSceneNode* setMesh (IAnimatedMesh *aMesh = 0, bool updateOptimalCamDist = true);
        IAnimatedMeshSceneNode* setMesh (stringw aFileName, bool updateOptimalCamDist = true);
        void enableMouseRot (bool aEnable);
In the Demo only the setMesh and the enableMouseRot functions are used so show the standard Case of using it as "Mesh-Showcase"

So if you want to use it in an other way you can easily doo this by using the GetScene function to get a Pointer to the ISceneManager of the GUIScene.

By using this Pointer you can setup your sceene as already known.

The SetOptimalCamDistToNode function allows you to focus anny node of the Scene you have created. It Calculates the optimal Position for the Camera to show the whole node in the GuiScenes Clipping-rect based on the boundingbox of the given node.
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: GuiScene

Post by Granyte »

wow I completely missed this when I looked at your code it's really great is there any usage restriction on your code?
Der Walden
Posts: 7
Joined: Fri Jul 20, 2012 2:12 pm

Re: GuiScene

Post by Der Walden »

:wink: Without irrlicht this code would not exsit... So no there is no usagerestriction. Beeing informed about improvements or bugfixes would be nice.
Post Reply