Enhancing the model viewer.

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Enhancing the model viewer.

Post by christianclavet »

Hi, I saw some ideas from DLANGDEV that worked a little on the model viewer and tried to enhance it. I liked the idea and worked a little on it on my own. I worked on the irrlicht 1.4 version of the code.

- Implemented the four viewport/single viewport feature.
Moving the view still require some more coding (basic working)
- Added animation control to stop or play the animated mesh at specified
speed
- Added a base grid for reference (10 IRRlicht units per grid elements)

Here is a picture showing the interface now:
Image
Full size pic here: http://www.clavet.org/files/images/ModelViewer.jpg
Image
Full size pic here: http://www.clavet.org/files/images/Interface.jpg

EDIT[January 29th 2008]
Added new features and improved my modifications of the model viewer
- Viewport camera have now a orthographic projection (thank for the help)
- Now able to move the view with the right mouse button
- Zoom each orthographic viewport with the mouse wheel
- Each orthographic viewports are independant (view position and size)
Image

- Added menus for exporting (code not yet implemented)
Image

- Added a light menu to adding Lighting on the model and add a shadow volume
Image

You will need to put that picture in your "media folder": Image

Just do a copy of your main.cpp in the Model Viewer demo in your IRRlicht example and create a new main.cpp with this:

here is the file: http://www.clavet.org/files/main.cpp
Please make a backup copy before replacing with this file.
Last edited by christianclavet on Fri Feb 01, 2008 6:31 am, edited 6 times in total.
trivtn
Posts: 132
Joined: Tue Jan 17, 2006 12:30 pm
Location: Viet Nam
Contact:

Post by trivtn »

Nice code! thank !
There's something is fantastic, there's nothing is absolute.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Very nice work, maybe add to official irrlicht?
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

perhaps... But the code will need to be cleaned by a professionnal programmer.

Also, i'm not sure but I'll post a bug report for the TAB that cannot be selected, when it's used in a window. Used directly in the application, I can select tab without problem.

I also want to work on the views so that we can move the view correctly. Right now it's not good. But for the viewport feature, it's working very well. Too bad, I never saw code using this.

Anyone know about creating an orthographic projection to be applied to a camera?
lucascaro
Posts: 2
Joined: Mon Jan 28, 2008 3:56 am

Post by lucascaro »

Hi! i'm new here but it seems that this deserves to be a full project.
It whould be nice to have something like this in sourceforge or something like that, and i think we can have enough developers for this.
Anyways, it's starting to look nice, and we (i) need a cross-plataform extensible editor for irrlicht.

Edit: Ah! it whould be nice to have the code in an svn server too!

See ya later!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

dude thats just the meshviewer that comes with irrlicht. He just added 3 viewports and a groundgrid...
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
lucascaro
Posts: 2
Joined: Mon Jan 28, 2008 3:56 am

Post by lucascaro »

i know, i was just looking for an open source scene editor for irrlicht, and just thought that this could be a base for it.
Maybe i'm missing one that already exists (and is multi platform), i don't know.
Anyways, i just was trying to make something useful, but maybe looking too far away in the future.
Well, if you know one(either an editor or an open source project to make one), i'll be glad to hear about it.

Thanks.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, Guys.

Just added other things to my modified Meshviewer... :wink:
I updated the first post to reflect the changes.

The source is still there, but in download.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

awesome, chris.

keep it up, it's getting better.
Image
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

I put whatever weight I have that this become the new model viewer distributed with Irrlicht, especially if functionalities keeps on adding up ^^
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Perhaps they could put it with the source but rename it: advanced mesh viewer. The mesh viewer serve 2 thing.

- Reading it's code for learning
- Use of the application

Mostly all example so far are for beginner. This code would be too much for somebody who would start with IRRlicht. (In fact, that could be a good thing, if we had other new example in the future (experienced, advandced level)

If this code will be included, I hope that someone (expert) will clean up the code so it follow the programming guidelines. I'm not that good, and it would surely need a little clean up for that.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

If You need mesh Viewer You also use my Viewer from this link:
http://rapidshare.com/files/85805476/Ch ... _v0_99.zip
or
http://www.sendspace.com/file/3oo1hf
This is beta version. This have support for: normal and specular lighting, per vertex lighting, play animations, compare two meshes eg. box geometry and mainly mesh etc. ReadMe is only in polish, but if You want support You can put questions here:)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, Nadro.

I've checked you model viewer. Nice to see that you integrated IRRcg in it and that you can see the model with shaders.

You could perhaps do a quick update for the viewports features by grabbing the code here?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

HI. I will plan replace Irrlicht GUI by wxWidgets. Of course I can add 4 viewports support:) I'm waitng for ATI drivers for Linux for my Radeon 2600 PRO on AGP, and after it I release Linux version of viewer:) I create topic in Projects section about my Model Viewer:)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi,

I've worked again on the source.

This time I fixed a lot of things, and started some thing that will show you the direction I'm going. I will put some more time on this because, I need to understand well how to bring some character in an engine. So this is a practice and tool for me, for my "FIRST KING" project, when I will get back on it. (It also make me more than happy to see this working like the Lightwave modeler) 8)

- Fixed a memory leak caused by the definition of the orthographic cams
- Fixed the way we move the views in the ortho view. Now it's working as I like. (It's like moving a sheet of paper with the mouse)
- Added a way to add/remove shadows (3 Light setup, but one light is casting shadows. Having more than 1 shadow impact severely on the framerate and display quality.)
- Display the mesh polygons count correctly now (displayed the scene polygons count before)
- Display the current frame of the mesh animation and the mesh type (animatable or not)
- Started a Animation window should allow to control the way the animation is played. Base started but nothing functionnal there. Will need a function to refresh that part of the gui
- Planned to have a surface explorer to change the textures, mode etc.

here is the file: http://www.clavet.org/files/main.cpp
Same location as in the first post of this thread.
Post Reply