CMP to SUR Conversion Tests
-
I don’t have 1.1 source - Louva Deus may well have it.
But to save you time, here is the link for 1.2b3 if you don’t already have it, or for anyone else that needs it:
http://eoa.seriouszone.com/download.php?file=surexportersrcAnd here is the importer source if it is useful:
http://eoa.seriouszone.com/download.php?file=surfileprogramsThere are some other archives at the EOA that may be useful:
http://eoa.seriouszone.com/colinsanby.phpAnd also check the side panel on that page for more.
-
Here is my decompilation of the function that makes use of the “RGB” values. I’ve used my names, this time.
// It's not actually this, but some sort of dynamic array. std::vector <theader*>THeaderVec; // Common.0634a9b0 (v1.1) // ecx points to six floats, looks to be the bounding box. Not used, though. void Extents::FindTriangleGroup( Bit* bit, // esi const Vector& centre, // ebp float radius, THeaderVec& face_list ) // ebx { for (;;) { float dx = bit->centre.x - centre.x; float dy = bit->centre.y - centre.y; float dz = bit->centre.z - centre.z; if ((radius + bit->radius) * (radius + bit->radius) < dx*dx + dy*dy + dz*dz) return; float scale_radius = bit->radius / 250; if (scale_radius * bit->scale.x + radius <= fabsf( dx )) return; if (scale_radius * bit->scale.y + radius <= fabsf( dy )) return; if (scale_radius * bit->scale.z + radius <= fabsf( dz )) return; THeader* group; if (bit->tri) { group = (THeader*)((char*)bit + bit->tri); // edi if (group) // ? this will always be true break; } if (bit->sibling) { FindTriangleGroup( bit + 1, centre, radius, face_list ); bit = (Bit*)((char*)bit + bit->sibling)); } else { group = (THeader*)((char*)bit + bit->tri); // edi if (group->triangles == 2) { // triangle_list is simply the triangles after the header. if (radius * radius < unknown( group, group->triangle_list, centre ) return; } break; } } face_list.push_back( group ); }</theader*> ```There, that's one function down…
-
Keep it up adoxa, many thanks for your excellent help to Lancer, between you two we hope for a new evolution to model making!
I feel so… where’s my toy digger again??!!
-
**Ok, just had to learn a whole new branch of mathematics. I have had to learn how to create convex hulls based on an arbitrary mesh. This will be implemented into the sur conversion routine soon to do the sur linkage mesh. Here is an example of the Nomad Lair hull being built and animated.
[wmp=640,480]http://digitalbrilliance.org/Files/ConvexHull.wmv[/wmp]**
-
That is amazing, LS. Well friggin’ done!
-
FWIW, I’ve put up one more final revision of my Sur Dumper. Fixes a bug where ScaleZ was output using ScaleY’s value; displays the scale values as decimal fractions; and adds an option to prefix relevant lines with the file offset.
-
Thank you again Adoxa.
By the way, all I see in the video is the sur being drawn in about 1.5 secs, there is no lair shape - is that correct or is there more I can’t see?
Waiting with 'bated breath for the sur generator, Lancer!
-
**You should see it being built then then the background turns blue and the model rotates.
The model is nomad_lair.cmp in solar/dockable**
-
How are you getting along with it, LS?
We could really use the SUR LODs, having highly complex surs when near, but having more simple surs when far away.
Seeing that you have a good understanding of the file structure, could you build some sort of sur-builder where you simply pass in geometry to be used for the different sur-lods and other parts of the sur file format?
That would be really great.
While a simple cmp to sur converter is cool, I think in most cases it would have the problem of producing too complex surs.
-
Odd, it builds and stops and returns to zero without turning blue or rotating. I see only the sur wireframe being built. I’m using firefox.
-
**Here is a link, right click and save target to ur hd. Then u can play it in media player.
http://digitalbrilliance.org/Files/ConvexHull.wmv
Wodka, actually that is the way I test the program atm. I simply export the VMeshData to my hd and parse the vertices out of it. Convex hull generation is inherently a mesh reduction type of mesh builder. I am also going to look into error tolerance mesh reduction for sur lod levels if the bits stuff turns out to be that. The test program for the convex hull atm doesn’t care where the vertices come from as long as the format is vertex = x,y,z. It also supports mesh parts as well but that is for testing only at this time. I am considering just making it a small seperate program for the time being until the sur stuff is completely bug fixed…**
-
Lancer, you say vertex = x,y,z … sounds similar to .obj format, do you mean it will be possible to use .obj meshes to generate a sur file?
If so that could be a good thing too, as .obj is a simple text format, it would then be possible to generate from 3ds Max and other modellers too, only needing to export the .cmp from Milkshape?
-
Concievably any mesh format can be used. Only the vertices are needed to build the convex model which every mesh format contains.
-
StarTrader is still chomping at the bit waiting for the beta…
-
**I got the convex hull stuff pretty much working ALMOST perfectly. As the code is now I am going to go ahead and start building the sur conversion routines with it. It isn’t absolutely perfect since some models seem to cause it to make way too many faces. It’s usually only happens on really high poly count models. So far out of about 30 models only 2 have caused problems. I will have a 3D preview mode so you can abort making the sur if it screws up. Hehe, I just learned how to make them so I am still a bit of a novice at it.
As it stands I will make it make a convex root sur starting out for the first release. Then I will add in the ability to create all of the sub-sur parts including the main root sur. Your just going to have to bear with me as I still have to figure out how all of the sub-bits sections work together, until I do the hull collisions won’t even work at all for the sub-parts of the meshes. I am also looking into mesh partitioning for meshes with holes in them (IE tradelanes) so if you are wanting it for that it won’t work as is. It currently covers over the tradelane rings completely which would render them impossible to enter into.
For those of you making your model as a single part model, don’t even bother trying this software. It will simply cover the entire thing with a single sur file, nothing more at this point. This is NOT a replacement for custom sur files, it is a general purpose tool for those of us who want a form fitting convex hull without the hassle of building a sur-splitter file layout. If you do split your model into multiple pieces, it should work really well for you once I get the sub-part builder going good. I am a big fan of multi-part meshes, it just makes more sense to me and it makes the models easier to edit later on…**
-
When exporting from Milkshape you can make it multi-part mesh, up to 18 parts. If it’s exported as a single part it will simply cover the entire model as a single sur map. I have not delved into Delaney triangulation yet which would yield per face triangulation.