Posted: Sun Jul 08, 2007 7:07 pm
Just to be clear (and I’m sure everyone will agree about the lucidity of what follows):
Oolite’s “DAT” format describes a set of convex polygonal faces with up to 16 vertices. “Convex polygonal” is well-defined: it refers to a set of coplanar points, ordered such that removing any point will not increase the area of the resulting shape. When loading, Oolite ensures that there are no more than 800 (512 in previous versions) such polygons.
In order to display this data efficiently, it must be 3-tessellated ;-), which it seems Oolite does, although I’m not entirely sure where. In doing so, it stores the resulting triangles in a fixed-size array of 800 (512 in previous versions) triangles. This always creates at least as many triangles as there are polygons in the source file, but could in principle result in up to 14 times as many, resulting in a potential buffer overflow.
The proper solution to this, which is not yet implemented, is to avoid using fixed-size buffers.
Since the aforementioned 3-tessellation occurs within the game, you’re unlikely to find it in the conversion script.
Oolite’s “DAT” format describes a set of convex polygonal faces with up to 16 vertices. “Convex polygonal” is well-defined: it refers to a set of coplanar points, ordered such that removing any point will not increase the area of the resulting shape. When loading, Oolite ensures that there are no more than 800 (512 in previous versions) such polygons.
In order to display this data efficiently, it must be 3-tessellated ;-), which it seems Oolite does, although I’m not entirely sure where. In doing so, it stores the resulting triangles in a fixed-size array of 800 (512 in previous versions) triangles. This always creates at least as many triangles as there are polygons in the source file, but could in principle result in up to 14 times as many, resulting in a potential buffer overflow.
The proper solution to this, which is not yet implemented, is to avoid using fixed-size buffers.
Since the aforementioned 3-tessellation occurs within the game, you’re unlikely to find it in the conversion script.