Lightwave converter
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
It seems Ogre assumes that objects are 0,0,0 centric. To me this isn't a very realistic assumption.
Example:
A character standing usually stands on floorlevel at 0. If the character is 2 meters tall, the bounding sphere should then be 1 meter instead of 2.
Hmm ... I probably have to take some pivotpoint into the equasion.
Example:
A character standing usually stands on floorlevel at 0. If the character is 2 meters tall, the bounding sphere should then be 1 meter instead of 2.
Hmm ... I probably have to take some pivotpoint into the equasion.
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
-
- Gnoblar
- Posts: 19
- Joined: Mon Aug 16, 2004 1:48 am
- Location: East Sussex, England
Hi Dennis,
sorry if this has been suggested before - I did a search before making the code change and didn't find it on these forums.
I made a change to the lwo converter based on my own experience with material name conflicts for freeby downloaded meshes. The bunch I found all had the same names for many of the materials and so I couldn't get the variety of cars in my test scenes that I wanted.
I added a -n parameter option to the lightwave converter to permit the user to specify a superscript string that is added to all material names in both the material script and the output mesh file.
I just hacked it in using a global variable, but I think this would be a useful feature for very many of your tool's users so perhaps you would consider adding it (more neatly!) to the next update?
BTW: thanks for an incredibly useful tool
cheers
Pete Baron
antispam_sibaroni@hotmail.com (remove 'antispam_' to mail me)
http://home.btconnect.com/pete/homepage.html
sorry if this has been suggested before - I did a search before making the code change and didn't find it on these forums.
I made a change to the lwo converter based on my own experience with material name conflicts for freeby downloaded meshes. The bunch I found all had the same names for many of the materials and so I couldn't get the variety of cars in my test scenes that I wanted.
I added a -n parameter option to the lightwave converter to permit the user to specify a superscript string that is added to all material names in both the material script and the output mesh file.
I just hacked it in using a global variable, but I think this would be a useful feature for very many of your tool's users so perhaps you would consider adding it (more neatly!) to the next update?
BTW: thanks for an incredibly useful tool

cheers
Pete Baron
antispam_sibaroni@hotmail.com (remove 'antispam_' to mail me)
http://home.btconnect.com/pete/homepage.html
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
-
- Gnoblar
- Posts: 8
- Joined: Wed Sep 01, 2004 11:46 am
- Location: Århus C, Denmark
Where's the source?
Mjello.
I've got the source for this tool from cvs, but it seems that there's been no change in the cvs repository for this tool for a long time. And the source in CVS doesn't compile with g++, and there aren't any makefiles either. So before I begin to write / "port" it to linux, I would loooove to know if there's a different updated source somewhere which compiles using g++ =) And where it is, of course =)
I've got the source for this tool from cvs, but it seems that there's been no change in the cvs repository for this tool for a long time. And the source in CVS doesn't compile with g++, and there aren't any makefiles either. So before I begin to write / "port" it to linux, I would loooove to know if there's a different updated source somewhere which compiles using g++ =) And where it is, of course =)
Magnus Møller Petersen
-
- Halfling
- Posts: 71
- Joined: Mon Aug 09, 2004 8:28 pm
- Location: Austria
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
Yes, I still maintain it. There's a patch in the queue ...
http://sourceforge.net/tracker/?group_i ... tid=302997
The last patch was to keep the converter up to date with 0.14. The source is in \ogrenew\Tools\LightwaveConverter. I currently use VC6 only.
http://sourceforge.net/tracker/?group_i ... tid=302997
The last patch was to keep the converter up to date with 0.14. The source is in \ogrenew\Tools\LightwaveConverter. I currently use VC6 only.
-
- Greenskin
- Posts: 110
- Joined: Wed Sep 08, 2004 11:49 pm
- Location: Lausanne, Switzerland
Working with Lightwave is good. Exporting from it is better
Good to know
- Sput

- Sput
-
- Halfling
- Posts: 71
- Joined: Mon Aug 09, 2004 8:28 pm
- Location: Austria
-
- Gnoblar
- Posts: 8
- Joined: Wed Sep 01, 2004 11:46 am
- Location: Århus C, Denmark
Doggie does Debbie's Dallas.
You have to go through sf.net:Meddten wrote:How can i apply a patch with tortoise cvs?
Code: Select all
http://sourceforge.net/tracker/?func=add&group_id=2997&atid=302997
Magnus Møller Petersen
-
- Halfling
- Posts: 71
- Joined: Mon Aug 09, 2004 8:28 pm
- Location: Austria
oh sorry for my misunderstanding spelling. i didn´t want to create a patch file i want to download this patchfile
http://sourceforge.net/tracker/index.ph ... tid=302997
and apply it to my version of ogre on my harddisk
how can i do that
http://sourceforge.net/tracker/index.ph ... tid=302997
and apply it to my version of ogre on my harddisk
how can i do that
-
- Gnoblar
- Posts: 8
- Joined: Wed Sep 01, 2004 11:46 am
- Location: Århus C, Denmark
Patching all the way.
I'm not sure you can do that with Tortoise CVS. If you were using Linux, you would normally use the program called 'patch'. Or you could apply the patch by hand, by opening the patch-file, and copy-paste the changes to the files (only four files).
I'm sure other people know how to do this "the proper way" when using Windows =)
5 minutes later...
I found a windows port of patch. You could try that one out:
I'm sure other people know how to do this "the proper way" when using Windows =)
5 minutes later...
I found a windows port of patch. You could try that one out:
Code: Select all
http://gnuwin32.sourceforge.net/packages/patch.htm
Magnus Møller Petersen
-
- Gnoblar
- Posts: 8
- Joined: Wed Sep 01, 2004 11:46 am
- Location: Århus C, Denmark
discontinuous vertex maps
The lightwave converter doesn't seem to support lightwave objects with discontinuous vertex maps. It converts them with no errors, but the texture mapping is all wrong when the object displayed in Ogre.
Magnus Møller Petersen
-
- Gnoblar
- Posts: 8
- Joined: Wed Sep 01, 2004 11:46 am
- Location: Århus C, Denmark
LightwaveConverter Linux patch.
I've submitted a patch to make the converter compile / work under Linux with GCC.
http://sourceforge.net/tracker/index.ph ... tid=302997
http://sourceforge.net/tracker/index.ph ... tid=302997
Magnus Møller Petersen
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
Re: discontinuous vertex maps
These discontinuous vertex maps are known as VMADs in the .lwo-format. They are probably one of the greatest assets to the .lwo file format. It's just that they are evilTSi wrote:The lightwave converter doesn't seem to support lightwave objects with discontinuous vertex maps. It converts them with no errors, but the texture mapping is all wrong when the object displayed in Ogre.

A VMAD provides an extra set of UV-coordinates which is tied to the polygon instead of the vertex itself. This means that for the conversion to work, the vertex has to be copied in order for it to contain the second UV-coordinate. Since I probably won't use VMADs any time soon, I don't know when I'll get around to implement a fix.
-
- Gnoblar
- Posts: 8
- Joined: Wed Sep 01, 2004 11:46 am
- Location: Århus C, Denmark
Re: discontinuous vertex maps
I thought Lightwave, as default, saves objects with VMADs if applicable. *shrug* I guess I'll look into it when I have time, and when fixing buuugs =)dennis wrote:Since I probably won't use VMADs any time soon, I don't know when I'll get around to implement a fix.
Magnus Møller Petersen
-
- OGRE Retired Team Member
- Posts: 419
- Joined: Mon Jan 27, 2003 11:51 pm
- Location: The Woodlands, TX
-
- OGRE Retired Team Member
- Posts: 419
- Joined: Mon Jan 27, 2003 11:51 pm
- Location: The Woodlands, TX
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
Instantiating MeshManager seems to be requirement now ...
Code: Select all
Index: Tools/LightwaveConverter/src/main.cpp
===================================================================
RCS file: /cvsroot/ogre/ogrenew/Tools/LightwaveConverter/src/main.cpp,v
retrieving revision 1.6
diff -u -r1.6 main.cpp
--- Tools/LightwaveConverter/src/main.cpp 23 Oct 2004 22:24:26 -0000 1.6
+++ Tools/LightwaveConverter/src/main.cpp 25 Oct 2004 15:24:38 -0000
@@ -19,6 +19,7 @@
Math* mth;
MaterialManager* matMgr;
SkeletonManager* skelMgr;
+MeshManager* meshMgr;
MeshSerializer* meshSerializer;
MaterialSerializer* materialSerializer;
SkeletonSerializer* skeletonSerializer;
@@ -651,8 +652,9 @@
{
logMgr = new LogManager();
mth = new Math();
- matMgr = new MaterialManager();;
- matMgr->initialise();
+ matMgr = new MaterialManager();
+ matMgr->initialise();
+ meshMgr = new MeshManager();
skelMgr = new SkeletonManager();
meshSerializer = new MeshSerializer();
materialSerializer = new MaterialSerializer();
@@ -709,9 +711,10 @@
else
{
delete bufferManager;
- delete skeletonSerializer;
+ delete skeletonSerializer;
delete materialSerializer;
delete meshSerializer;
+ delete meshMgr;
delete skelMgr;
delete matMgr;
delete mth;
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
Since the matter of supporting VMAD's (discontinuous vertex maps) has come up I feel strong about throwing out some code and do it better.
The datastructures for referencing this mapdata are really complex. What also intrigues me is the way different types of vertexdata can be declared separately. (VertexDeclaration) Does this mean I CAN attach 2 UV-coords to a vertex even though Sinbad stated I can't? (Actually this means attaching a second UV-map to all the vertices and not a single UV-coord to a single vertex.)
One thing I would like to do is to get the best possible mesh after conversion. Currently vertices are being copied per surface/submesh in the order they are encountered. This means that a single triangle could have one vertex at the start, one at the middle and one at the end of the vertexbuffer. Does that matter?
My idea is to traverse the triangles of a surface in some way and copy the vertexdata along the way. What would be the best traversal algorithm?
What should be taken into consideration for the optimal use of the shared vertex data structure? (Currently the user decides if the vertex data should be shared or not. The user can't specify which submeshes should share a vertex data buffer.)
The datastructures for referencing this mapdata are really complex. What also intrigues me is the way different types of vertexdata can be declared separately. (VertexDeclaration) Does this mean I CAN attach 2 UV-coords to a vertex even though Sinbad stated I can't? (Actually this means attaching a second UV-map to all the vertices and not a single UV-coord to a single vertex.)
One thing I would like to do is to get the best possible mesh after conversion. Currently vertices are being copied per surface/submesh in the order they are encountered. This means that a single triangle could have one vertex at the start, one at the middle and one at the end of the vertexbuffer. Does that matter?
My idea is to traverse the triangles of a surface in some way and copy the vertexdata along the way. What would be the best traversal algorithm?
What should be taken into consideration for the optimal use of the shared vertex data structure? (Currently the user decides if the vertex data should be shared or not. The user can't specify which submeshes should share a vertex data buffer.)
-
- Gnoblar
- Posts: 8
- Joined: Wed Sep 01, 2004 11:46 am
- Location: Århus C, Denmark
If it does, then you could probably sort the stuff afterwards?dennis wrote:One thing I would like to do is to get the best possible mesh after conversion. Currently vertices are being copied per surface/submesh in the order they are encountered. This means that a single triangle could have one vertex at the start, one at the middle and one at the end of the vertexbuffer. Does that matter?
Humm.. My idea is to eliminate the VMADs after the object has been loaded, but before you convert the object to a mesh. So I have been looking at doing something like this:dennis wrote:My idea is to traverse the triangles of a surface in some way and copy the vertexdata along the way. What would be the best traversal algorithm?
Code: Select all
lwObject::eliminateVMADs() {
for each layer {
layer->eliminateVMADs();
}
}
lwLayer::eliminateVMADs() {
for each vmap {
if vmap->perpoly {
for each point {
check polygon, check vertex, replace uv-coords for points in toher vmaps.. yada yada.. not totally sure how to do this yet.
}
}
}
}
Magnus Møller Petersen
-
- Gremlin
- Posts: 157
- Joined: Mon Nov 11, 2002 4:21 pm
- x 3
I think traversing the polygons in the right order should solve everything in 1 go. I also think spreading the vertices of a single triangle out over the buffer is a bad idea, but I would like to know what some other experienced people think about this. Is the buffer optimised (stripified?) before it's written to disk?
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
The serializer does absolutely nothing to the data apart from writing it. Yeah, having vertices scattered around the buffer is sub-optimal since the vertex cache will not be used to its full. I would iterate over the faces of the mesh and identify unique vertices as you go. Alternatively nVidia has a vertex cache optimising tool IIRC which might offer some tips on this.