Codemasters very kindly supplied me a race track, but it was in max format. We grabbed a copy of max and tried to export the meshes as 3ds or wavefront obj files without success. The problem is with the materials, the codies have tied 3ds max into their development system so tightly that it uses the same shaders as the game does. Understandably they were not willing to give us their shaders, so we were stumped.

We got in touch with another company who put a GA on the task, he managed to re-texture the meshes, but when he tried to export them, the 3ds file was corrupt, and the wavefront obj file had duff texture coords and materials.

So back to square one.

I bought a race track from turbosquid, at first it looked ok, but when I looked in detail at the mesh a lot of the normals were facing the wrong way.

I'm not going to waste money buying another useless mesh, and I don't have the ability to go through 300,000 triangles checking each normal by hand.

So anyone have any ideas? This was supposed to be a 1 month project, 1 month later I still don't have a use-able race track mesh and my teddy bear has left the building.

rouncer
—
2013-06-07T08:39:26Z —
#2

Why dont you try procedural generation?

Theres lots of nifty ways one could put a race track together, they are essentially strip models...

tyree
—
2013-06-07T19:46:42Z —
#3

to stainless, if its a race track you shouldnt really need special shaders or normal mapping. really the model and paint should do it. any normal mapped or special shader version of the track. should be extra versions of the track but not the main version. if your up for it, Ill take a look at it

fireside
—
2013-06-08T00:38:25Z —
#4

Not sure how complicated it is, but I believe you can use a formula to normalize triangles. That's about as much as I know. Blender has something to normalize triangles of an object, but it doesn't always work. The more complicated the model, the less it works. The trouble with getting models from places is that a lot of modelers don't know much about low poly models and keeping there models more intact. They figure if it looks good, that should be good enough.

Stainless
—
2013-06-08T13:50:27Z —
#5

Procedural generation is no good, has to be a real place.

Tyree, the issue is not the mesh. I can extract the verts and faces no problems. The issue is texturing it. I have had a guy re-texture the mesh, but even he cannot export it from max.

I really don't know what they have done in the mesh that is causing so many problems. I know the file contains low and high poly versions of all the buildings, and it contains a mesh that is only used in the physics system, but that really shouldn't cause these problems.

I could write some code that goes through the mesh and finds triangles connected by two verts that have normals facing in the opposite direction, but there is no way of deciding which normal is correct. So I would still have to alter it by hand.

Not sure what to do.

fireside
—
2013-06-08T15:33:37Z —
#6

Maybe you could export the mesh and re-import it, or just make a copy. In Blender, there is a problem with number of users or something like that and it won't let me do certain things. I make a copy, and it's all right. Haven't used mega bucks 3ds so don't know anything about it. Normals, it will probably involve going over the model and changing them by hand. That's what I end up doing. They become clear if they are facing the wrong way in Blender, or used to anyway. The more joining and mirroring I do, the more they end up the wrong way. Good to know 3ds is just as bad so I'm not missing much. The exported model just marks where the texture goes and the name of it. I guess you would know that. 3ds is a very old format, most are using FBX anymore. It works, but texture names have to be less than 8 characters long I think.

vrnunes
—
2013-06-09T00:04:01Z —
#7

3DSMax has "Unify Normals" that will convert all triangles to the same winding. I would try that.

to stainless when I said paint, thats what I meant. you cant paint a model without texturing it. if the model is giving you problems, why not make new duplicate versions of the model

Stainless
—
2013-06-09T08:33:19Z —
#9

I don't personally have a copy of max, the only copy we have in the company is on a 64 bit machine in an office 60 miles from me.

When I need to use it I log onto the machine remotely, but that's hardly ideal.

The guy I was using to do the work has gone dark, I guess he couldn't sort out the problems.

At the moment I have grabbed a copy of an open source racing game and I'm ripping the tracks out of that for the demo. The company will have to pay someone to create new meshes if we decide to go from demo to real game.

tyree
—
2013-06-09T13:42:30Z —
#10

just so you know the answer could have been as simple as exporting it to a different format, which would correct the normals

TheNut
—
2013-06-09T15:36:34Z —
#11

I'm not sure it would correct the normals as quite often artists do not care about the winding order of polygons. Polygons are double sided in renderers so they don't have those problems. If you have some time, load the meshes in Blender. It's very easy to correct the winding order. Just enable face normal viewing and you will see the problematic polygons. Enable face selection, select the incorrectly winded polygons, then flip them all at once. Shouldn't take long. I've done this for very high res meshes and usually it doesn't take me any longer than several minutes.

As for the original problem, have you tried looking into the effort involved in writing a max exporter? OBJ and 3DS exporters are very flaky and for best results I find you really do need to export the data yourself. It also helps if you triangulate the polygons before you export. If they're quads or higher order polygons, then you would need to properly convert them yourself. Some renderers like Blender also assign UV coordinates per index rather than per vertex. So if your texturing is messed up, it's probably because 3DS does the same thing. You need to duplicate shared vertices and reassign the UVs to correct that behaviour.

Stainless
—
2013-06-09T19:13:03Z —
#12

It looks far more complex than that, some of the output UV coordinates end up with three terms.

The meshes that generate missing shader errors don't get exported at all if we do an export to 3ds.

I'm just really fed up with it all at the moment, this whole 3d file format thing is just a mess. I installed blender and downloaded a oad of scripts to handle all the file formats I need to use, none of the scripts work. Hell I had to edit them just to get them to appear in blenders list.

It's about time we had a standard instead of everyone just creating their own format whenever they want.

I hate blender with a passion, I don't have the patience to try and learn it's awful user interface. Things that are obvious and trivial in every other 3d editor I have ever used, I find impossible in blender.

3d studio is awesome, but so expensive I can't afford to have my own copy.

I hate blender with a passion, I don't have the patience to try and learn it's awful user interface. Things that are obvious and trivial in every other 3d editor I have ever used, I find impossible in blender.

What's kind of funny is they redid the interface to make it more intuitive, and it's even worse. That's what happens when nerds make things intuitive. It took me forever to figure out how to make bone animations because it's filed in a hidden menu under "dopesheet". I love it and hate it, really. Once you get to know how to use it, you can really be productive, but the learning curve is immense and they are always breaking something on it, especially the exporters and importers. I'm using a version about 2 years old right now because the exporters work a lot better. Most of them are broken in the current version. For something intuitive, look at Sketchup, but you will still have a horrible time with exporters and importers unless you pay for the pro version or can use a collada format. Nice program, though. I mostly use it as a home cad program but also do starter models that I texture in Blender. It wouldn't be much good at repairing a model, though. Another kind of intuitive free modeler is Wings 3d. It doesn't do animation, but is easy to figure out as far as modelers go.

rouncer
—
2013-06-10T03:53:45Z —
#15

Heres some pgen i did a while back but i didnt finish the project, just based on distance fields. It was piece of cake.

of course its not polys just yet, youd have to go through a conversion process... but i think procedural generation kicks ass!

Stainless
—
2013-06-10T08:37:53Z —
#16

@Albertone I use polytrans all the time, it's awesome. It has a really useful set of tools. Combine meshes by material is one I use all the time, and quads to triangles. The 3ds file exported by max crashes it. :wacko:

@fireside Yes, I've had that problem before, lost a week when a GA upgraded blender and none of our scripts worked. I installed sketchup, but it's just as flakey as the rest. I've been through no end of editors, I have a copy of Anim8tor, I used to use gmax, there was a free one for XNA (which I have forgotten). What's the one which you paint the mesh in 3d rather than create UV's and texture it? Ahh it's a joke really. There seems to be as many 3d editors as there are 3d formats, possibly more.

@rouncer I am the king of procedural generation, I have several galaxies in my computer all generated from a single integer seed, but in this case it has to be a real world location.

fireside
—
2013-06-10T09:57:13Z —
#17

I installed sketchup, but it's just as flakey as the rest.

I installed it, watched about 4 video tutorials on their Youtube site, and was making buildings with doors, windows, and trim that were all sized properly in about 3 days. It doesn't do everything, but what it does, it does well. Most amateurs on Youtube choose it for architectural drawings.