Modular Level Building

Started by
13 comments, last by Emergent 13 years, 2 months ago

I just realized something about this method. It works in rotating the pieces together but it doesn't do anything about the requirement that each quad must face opposite one another. I guess I can just do a normals test to be sure that they are opposite one another after that....


Like haegarr noted, my answer hinges entirely on the 1-1 mapping between vertices.

If each quad has vertices,

A---B
| |
D---C

then the mapping (expressed in the ordering of the vertices in my {u1,...un} and {v1,...vn} lists) is,

quad1.A --> quad2.B
quad1.B --> quad2.A
quad1.C --> quad2.D
quad1.D --> quad2.C

Different orderings of the second set of vertices correspond to different ways in which the two pieces could conceivably attach.
Advertisement
I guess I can guarantee, at minimum that each golden area will be the same shape. I can also guarantee the order of the vertices- you see, in order to calculate the normals, the verts need to be ordered in counter-clockwise fashion. In my exporter, it exports 3 vertices (even if they have the same data) for every Triangle and includes a [-1, 1] XY T mapping data, so that we can check the order that specific vertice needs to be in, in that triangle... For the ordering of the triangles, from the first to the 3rd vert, if I graph the verts 1 by one on that XY plane then as each point is placed, they get placed in cc order.

This is an incomplete thought right now, but when exporting I can't guarantee that the exporter will place the top Triangle after the first one, but I can guarantee that fhe verts will have some kind of cc order. I'm going to have to do some more testing on that//look over the exporter's source code.
Also... I thought in your original post, you described connector regions consisting of two triangles, not both in the same plane. From that, I assumed that the vertex differences would be linearly independent. Now it's starting to sound like your triangles are coplanar, in which case this isn't true. Do you only have the four coplanar vertices that make up the quad? Then you'll also need to throw the normals into the U and V matrices (as additional columns) -- at which point we're approaching something very similar to what haeggar suggested.

Also... I thought in your original post, you described connector regions consisting of two triangles, not both in the same plane. From that, I assumed that the vertex differences would be linearly independent.

Now it's starting to sound like your triangles are coplanar, in which case this isn't true.

Do you only have the four coplanar vertices that make up the quad? Then you'll also need to throw the normals into the U and V matrices (as additional columns) -- at which point we're approaching something very similar to what haeggar suggested.


Each connector region (garea, as I call them [g for golden]) consist of 2 triangles that are both parallel to least one axis (i've noted above that I want them to be parallel to the Z axis, but I guess this limitation is arbitrary but meh just assume parallel to Z).

So yes, the triangles and the verts are all coplanar since they like along the same plane. However, Each connector region as you call it, may not be "coplanar"

So yes, the triangles and the verts are all coplanar since they like along the same plane. However, Each connector region as you call it, may not be "coplanar"


I'm sorry; I don't understand. At any rate, you'll know if you have a problem if, when you try to do the matrix inversion, you find out that the matrix is singular.

This topic is closed to new replies.

Advertisement