Show Mesh, a mesh viewer using Qt [v1.1 Released!]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Show Mesh, a mesh viewer using Qt [v1.1 Released!]

Post by Scrat »

Hi all,

Show Mesh has been upgraded to version: 1.1
Here is what it includes:
* Added Linux support
* Version bumped to OGRE 1.2.3
* Version bumped to Qt 4.2.0
* Moved the log and properties into dock widgets

Thanks a lot to CpuWhiz who made all the improvements of that version.

Download the windows version: here
Download the linux version: here

You can find the last version on the tools and addons sections of Ogre's site.
Or, you can go find Show Mesh on its SourceForce page: http://sourceforge.net/project/showfile ... _id=175833

-------------------------------------

Display Options :
• Solid / Wireframe / Points
• LOD
• Bounding Boxes
• Bones

Animation :
• List Animations
• Animation Playback

Materials :
• View Materials
• Switch Materials

Lighting :
• Light Angle Control
• Adjust Colors
• Ambient / Direct Light

Shadow :
• No Shadow / Stencil Modulative / Stencil Additive / Texture Modulative

Fog :
• None / Exponential / Exponential 2 / Linear
• Adjust Colors

I think it handled the most interesting things for this kind of app. I also integrated nxOgre in it but I realised that it wasn't really necessary so I removed it. Note that I took the floor of the nxOgre tutorials (hope you don't mind Betajen, but I really love your floor :D ;) )

I tried this program on two PC. Actually there is a bug in one PC because it can't find some textures in the material window. I really don't know why there is that bug but it is not a big deal.

Another thing, I really don't know how my program runs on small configurations so if you have problems to run it (too slow), juste tell me and i'll try to make a lighter version

Anyway, I hope you'll like and use Show Mesh :D

You can rotate the entity by using WASD or the arrows.
You can move the camera by left clicking on the mouse
You can zoom by using the wheel
And you can change the direction of the camera by right clicking on the mouse

Here are some pics:
Image
Image
Last edited by Scrat on Fri Nov 03, 2006 3:19 pm, edited 4 times in total.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 26

Post by Slicky »

This looks really good. I am giving it a test drive. It doesn't look like the material and textures paths are retained if changed.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Re: Show Mesh, a mesh viewer using Qt

Post by betajaen »

Scrat wrote:I think it handled the most interesting things for this kind of app. I also integrated nxOgre in it but I realised that it wasn't really necessary so I removed it. Note that I took the floor of the nxOgre tutorials (hope you don't mind Betajen, but I really love your floor :D ;) )
I thought it looked familiar, but no I'm cool with it :)
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

Looks nice. I gave it a try. Two things: I wasn't able to open a file by drag&drop it onto the viewer and for some reason it instantly crashes if I move it on my 2nd desktop attahed to the 2nd connector of my nvidia gf4. Pretty strange because I never had problems with moving Ogre windows from one desktop to another.
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

Marc wrote:I wasn't able to open a file by drag&drop it onto the viewer
Oh yes, I've forgotten to implement this function :P
I'll correct that in another version ;)
and for some reason it instantly crashes if I move it on my 2nd desktop attahed to the 2nd connector of my nvidia gf4. Pretty strange because I never had problems with moving Ogre windows from one desktop to another.
Well, that is really strange because I don't have this problem. I also have 2 monitors connected to the same card (an ATI, though).
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

Scrat wrote:
Marc wrote:I wasn't able to open a file by drag&drop it onto the viewer
Oh yes, I've forgotten to implement this function :P
I'll correct that in another version ;)
Oh, that'ld be cool. :)

For the crash bug: I can drag the window over to the other screen and exactly after releasing the left mouse button, it just crashes. Don't know if that helps you though. It also works for me with the old Ogre GUI Mesh Utility btw. It didn't use QT, but ATL though.
User avatar
Jerky
Orc Shaman
Posts: 791
Joined: Wed Mar 02, 2005 4:13 am
Location: Springville, Utah

Post by Jerky »

No crash on my ATI from 1 monitor to another. This one is really slick. It seems very stable. I havent tried any of my more complex meshes though. I will let you know if there are any problems. Nice work!
Erik Briggs (Jerky)
My Blog
Project Wish
Image
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

For the crash bug: I can drag the window over to the other screen and exactly after releasing the left mouse button, it just crashes. Don't know if that helps you though. It also works for me with the old Ogre GUI Mesh Utility btw. It didn't use QT, but ATL though.
No crash on my ATI from 1 monitor to another
Arf, another ATI vs nVidia compatibility problem ?
Thanks to both of you, I'll try to correct the bug
I havent tried any of my more complex meshes though. I will let you know if there are any problems
Ok, thanks
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

Here is the source code : http://www.gravytea.com/data/files/Source_Code.zip
You should already be familiar with Qt before viewing the source code especially with the moc files.
Just remember those lines : qmake and make (or nmake, using VC++). They'll create the moc files.
User avatar
smirnof.pl
Halfling
Posts: 59
Joined: Tue Apr 12, 2005 6:40 am
Location: Poland, Bielsko-Biala

Post by smirnof.pl »

Screenshots looks good. I have to download program and source 8)
good job !!
User avatar
rewinder
Halfling
Posts: 68
Joined: Fri Sep 24, 2004 5:15 am
Location: Omsk / Russia

Post by rewinder »

Great work man, quality viewer is a thing anyone needs. :wink:
By the way, why you doesn't use QMainWindow class which supports dockable windows and toolbars? Take a look at it, it is more usable than a regular sizer.
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

sminor.pl : Thank you :D

rewinder : First of all, Thank you too :wink:
Actually, I'm using the QMainWindow class in my MainWindow class. I also have included a little toolbar (which allows you to add a new light and import a new object) but it is true that I've totally forgotten to use dockable windows. :(
I'll keep this in mind for my next tool. :D
Thanks for your suggestion. I really appreciate. :P
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Yep, this Mesh Viewing Utility is slick! :)
And amazingly enough: it actually runs out of the box! Great! :P
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Jerky
Orc Shaman
Posts: 791
Joined: Wed Mar 02, 2005 4:13 am
Location: Springville, Utah

Problem viewing a normal mapped model.

Post by Jerky »

Anyone know why I get all sorts of colored artifacts when viewing a normal mapped model? The model (same .mesh, .material, and textures)works fine in the CeguiMeshViewer, but not in Show Mesh (or Vision for that matter). I would be fine, except that your viewers are so much better, and I cant zoom in the CeguiMeshViewer.

Does it have to do with the version of Ogre running? I know the cegui viewer is 1.06 (I think) and yours is probably using Dagon CVS.

Ideas?

I can post a ss and more info if needed.
Erik Briggs (Jerky)
My Blog
Project Wish
Image
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

Anyone know why I get all sorts of colored artifacts when viewing a normal mapped model?
Oh, I've never seen that bug before. This is strange because if you set the ambient light color to black, you can see the model "well-textured" but with black "pixels" on it (it's difficult to explain), but on some certain angles, the model is very clean. :?
I don't understand because Show Mesh is also running on Ogre 1.0.6 :o
ishraam
Gnoblar
Posts: 20
Joined: Tue Mar 21, 2006 11:57 am

Post by ishraam »

hello scrat,

I'm trying to bind Qt with Ogre, but am using Qt 4.1.1. Is there any particular reason why you didn't use Qt 4.1.1 but 4.0.1 ?

And I've just had my first time with Qt, so what about the moc stuff ?
I'm asking because I had no problem running Qt with a Makefile project (and qmake and all - followed a tutorial though, so I must admit I didn't take much time looking at qmake ...), which does not generate any moc_ file.

(I am working with Visual 2005 EE btw).

Basically, how could I generate my own moc files?

Thanks in advance, and sorry if that's too noobish for you :p.
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

Is there any particular reason why you didn't use Qt 4.1.1 but 4.0.1 ?
No, I didn't know that the 4.1.1 was released. I think you shouldn't have any compatibility problem using 4.1.1.
And I've just had my first time with Qt, so what about the moc stuff ?
I'm asking because I had no problem running Qt with a Makefile project (and qmake and all - followed a tutorial though, so I must admit I didn't take much time looking at qmake ...), which does not generate any moc_ file.
Well, to answer quickly, Qt uses a Signal/Slot system wich means that if you wan't your program to receive signal (like when you click on a button, for example), you have to include : Q_OBJECT on your class definition.
Example:

Code: Select all

class MatWindow : public QWidget
{
    Q_OBJECT

public:
    MatWindow(QWidget *parent = 0);
	~MatWindow();

	void setTexture(Ogre::Entity*);
	void setScriptPath(QString);
	void setTexturePath(QString);

signals:
	void msgBoxClicked();

private slots:
	void processMat(QTreeWidgetItem*);
	void saveMat();
	void updateTexture();
};
This Q_OBJECT instruction tells Qt to use a moc file in order to be able to receive signals/slots.
Ok so it's a good thing you work with VC++ 2005 because I use it too. To create a moc file, start the Visual Studio 2005 Command Prompt (Start/Programs/Microsoft Visual Studio 2005/Visual Studio Tools). Then go into your project's directory (cd <directory> (replace <directory> by your project's dir without the <>)). Then write <qmake -project> (without the <>) wich will create the Qt's project file (.pro). Then write <qmake> and then <nmake>. If everything goes well, you should have 2 folders created (debug and release). Depending on your build type (debug or release), the moc files will be generated in either the debug folder either the release folder. Then, you just have to bind these new files with VC++ (what I did is created a new folder called "Generated" in VC++ and put those files in this folder). And that's it !
Yeah I know this is quite tough but once you get the principle, it becomes very handy ;)
and sorry if that's too noobish for you :p.
Don't worry I've been through the same problems :D
ishraam
Gnoblar
Posts: 20
Joined: Tue Mar 21, 2006 11:57 am

Post by ishraam »

Strange...
I'm already doing the "qmake -project & qmake & nmake release -nologo" build command, but never saw any moc file popping out :).

I'll check that once more when I'll be back to work!
ishraam
Gnoblar
Posts: 20
Joined: Tue Mar 21, 2006 11:57 am

Post by ishraam »

Ok, sorry, I must have had a blurry mind yesterday.
I have no moc file since I use (at the moment) no signal at all. Silly me :p.

I'm simply trying to render something, without any user interaction - this will be the next point I'll try to add .
But as for now, I'm strug... YEAH I've finally made it ^_^ (*live action*)

Ok I've managed to render in a "QOgreWidget" (which ingerits from a simple QWidget, the way you did). Yeepeee. I'll try to change a few things here and there, and then add mouse/keyboard usage.
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

lol ok. Good luck ! :wink:
ishraam
Gnoblar
Posts: 20
Joined: Tue Mar 21, 2006 11:57 am

Post by ishraam »

I found something rather interesting that could enhance the behaviour of your app too, in the way draw calls are made.

When using a QWidget, it will always be erased before repainting. That's apparently the way it works by default in Qt. You can see it by commenting the code in your OgreView::timerEvent(...). You 'd then have nothing drawned, except on resizing the app.

You can change this default behaviour, which will also SMOOTH the repaint of your OgreView Widget (cause it's flashing on resizing, as you probably know).
Delete the draw calls in the OgreView::timerEvent(...), and simply add this line in your OgreView constructor :

setAttribute(Qt::WA_OpaquePaintEvent,true);

Believe me, that's worth the little change :).
EDIT : ..."worth"... Especially in term of CPU usage, since the app is no more drawing,erasing,drawing,erasing, etc...

*back to coding*
Last edited by ishraam on Tue Apr 11, 2006 5:22 pm, edited 1 time in total.
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

Wow very interesting ! I didn't know that. :shock:
Thanks for the tip. :wink:
SAT
Halfling
Posts: 64
Joined: Thu Aug 11, 2005 2:01 am

Post by SAT »

Is there a way to zoom in/out the model. Move the model up/down?
User avatar
Scrat
Halfling
Posts: 81
Joined: Fri Jul 22, 2005 5:46 pm
Location: Montreal, Canada

Post by Scrat »

Yep, you can zoom in/out with the mouse wheel, move the model up/down with the left mouse button and change the orientation with the right mouse button.
SAT
Halfling
Posts: 64
Joined: Thu Aug 11, 2005 2:01 am

Post by SAT »

Wow you where fast at answering. Thanks, I should have figured that out :oops: