popo wrote:From reading your synopsis (?!?) above I gather that Wonderland won't display 2 sided faces. Does this mean that if I set 2 sided faces in AC3D I will still have trouble? I ask this because I have a model of a bench that had some faces the wrong way but when I made them 2 sided in AC3D it looked ok. But in the game it still looked wrong. Is that why it still doesn't look right?
Yeah, in fact, most of the models I've worked with show up fine in AC3D, but not in the game. So it looks like Wonderland ignores the 2-sidedness. This is why I asked Patrick whether he could support 2-sidedness but he said no.
Popo wrote:BTW is it just for use with Milkshape or any 3D program?
It'll work with any 3D program, however, for the "duplicate and flip" part that you have to do yourself, AC3D provides much better support for it. In AC3D, you just select the whole model as a Group, do a copy, and then do a paste to get the duplicate, conveniently placed at the exact same location as the original. Then go to the menus and select "Reverse Vertex Order" and voila, you're done!
In Milkshape, it looks like you have to duplicate stuff group by group (remember that Milkshape's "group" = AC3D's "object"), and sometimes it looks like materials aren't handled correctly during duplication.
Popo wrote:Also, once you have 'autoflipped' the surfaces, why do you still have to 'duplicate and flip' them? Or would you only have to do it if you picked a wrong facing triangle in the first place?
I guess I should've explained it a little better (hence the help file in the released version). Ok, get ready for a slightly long explanation.
The thing is, my method relies on adjacent triangles. But in most 3D models you will get a number of disjoint surfaces where there are no adjacent triangles from one surface to another. For example, take the 4 wheels of a car. The triangles that make up each wheel will likely be all connected together in terms of adjacency; however, no triangle from one wheel will be adjacent to any triangles on the other wheels.
My method propagates the vertex order from adjacent triangles to adjacent triangles. As a result, it has to process disjoint surfaces independently. For example, with the 4 wheels, suppose my program starts off with a triangle on the front-left wheel. By propagating through adjacencies, the most you could cover are all the triangles on the front-left wheel, but you can't ever get to the other three wheels, because no triangles on the other wheels will be adjacent to a triangle on the front-left wheel. As a result, in order to process the other 3 wheels as well, you've have to do the propagation process once for each wheel.
Now here's the catch. My method always has to start off with a triangle that it assumes has the correct vertex order, and then propagates its vertex order through adjacencies. But currently I haven't found an easy-to-program way to actually get my program to pick a triangle that truly has the correct vertex order; instead my program just picks the first triangle listed in the file. As a result, it might either get a whole set of adjacent triangles all correct, or all incorrect. Now, because the propagation has to be done independently for each disjoint surface, it might be that it'll get some of the surfaces correct, but others incorrect. For example, with the 4 wheels, since each wheel is processed independently of the others, it might be that 2 of the wheels has the correct vertex order, but the other two aren't.
So to fix this, you have two choices. One, you go thru the model yourself, selecting the triangles that have the wrong vertex order, and then flip them. This sounds like zero improvement from before, but actually this isn't so bad, for two reasons:
1) after autoflip, adjacent triangles will have the same vertex order. So instead of having incorrect triangles scattered randomly throughout a surface, you end up with swaths of correct triangles and swaths of incorrect triangles. This should make it easier to select the incorrect ones.
2) it's often the case that a swath of incorrect triangles corresponds to a group/object, so rather than selecting the triangles, you could just select the group/object and then do the flip.
Still, this takes a bit of work, and moreover, in some cases you simply cannot fix the problem by flipping. For example, in the castle model, if you look at the drawbridge on the front, you'll see that it's only a 2D rectangle. Because of its angle, depending on how far you are from the castle, you get to see the rectangle both from its bottom side and from its top side. And so no matter which way you flip them, the bridge will disappear in one of the two possible views (top/bottom).
In order to fix this sort of problem, you really have to make a duplicate of the rectangle with the vertex order reversed. That way, no matter which view you're looking at the drawbridge from, either the original or the duplicate will have the correct vertex order, and so the drawbridge will never disappear. It's this general technique that I called "duplicate and flip", and it works on any kinds of surface.
And so that's why I recommend you to just do a duplicate and flip on the entire model, rather than going through the model parts by parts to flip/fix them. Of course, you do end up with twice the number of triangles after duplicate-and-flip.
-----------
One possibility as you suggest is to let the user pick the correct starting triangles for each disjoint surface. However, to do this, I'd need to write program to display the model, and allow the user to zoom/rotate/move around the model's 3d space in order to select the triangle to use. In short, I'd have to implement some of the functionalities you get in Milkshape/AC3D. Since I'm not really too experience in 3D graphics programming, I'd rather not have to do this.
One possibility I have considered is to have the program restructure the model so that each disjoint surface gets its own group/object. That way, you never have to select triangles directly, you can just select the group/object corresponding to the incorrect swath of triangles and then flip. The only thing is, it's actually somewhat involved to write a program to do this, because of the format of the 3ds files. It could be done, but unless you're really finding the duplicate-and-flip to be inadequate, I'd rather not have to write additional code to support this.
One other possibility is to have autoflip do the duplicate-and-flip for you as the step after it processed all the triangles. This is still somewhat involved to write a program to do, but not as bad. On the other hand, in some cases you might not want to fix the model via duplicate-and-flip. For example, after I did autoflip on that model of a frog I posted, I was able to just go through about 3 or 4 groups/objects and flip them to completely fix the model. This takes only a few minutes and avoids having to double the number of triangles you have, so in this case you might not want autoflip to impose the duplicate-and-flip upon you.
So yeah, the program as is right now could use some improvement, but hopefully it'll still be useful enough to be worth your time. I'd especially like to see whether, for example, it'll enable you to utilize the plant-making program Robbie (or is it sfseaman) pointed out.
And enjoy your vacation!