Woah! First off, I don't have the advantage of a full 3D rendering library, I'm trying to project this using 2D graphics functions only. So none of this "camera" jazz.
In my psuedo-3D coordinate system, x goes in a southeasterly direction, y goes in a northeasterly direction and z goes up.
Code:
|Z
-|-- /Y
-- | --
< | >
-- --
---- \X
(Yes that's supposed to be an isometric tile)
Second, I know nothing about strips, indices or culling, so the numbers you have provided are surplus to my needs (although I think you've got too many numbers on vertex 4! Have I got the hang of it? ).
I think there's a way that I can figure this out by turning the 4 vertices into 2 triangles in vertex order, working out the normals of each triangle and then doing something with those. If that something isn't right, then I simply shuffle the vertices into the other set of triangles (there are only 2 possible permutations).
In this vein:-
Code:
// make vectors of the vertices of triangle 1 and determine the normal vector
v1.x = tile->triangles[0].vertices[0].x - tile->triangles[0].vertices[1].x;
v1.y = tile->triangles[0].vertices[0].y - tile->triangles[0].vertices[1].y;
v1.z = tile->triangles[0].vertices[0].z - tile->triangles[0].vertices[1].z;
v2.x = tile->triangles[0].vertices[2].x - tile->triangles[0].vertices[1].x;
v2.y = tile->triangles[0].vertices[2].y - tile->triangles[0].vertices[1].y;
v2.z = tile->triangles[0].vertices[2].z - tile->triangles[0].vertices[1].z;
vn.x = (v1.y * v2.z) - (v1.z * v2.y);
vn.y = (v1.z * v2.x) - (v1.x * v2.z);
vn.z = (v1.x * v2.y) - (v1.y * v2.x);
For a triangle that's part of a "flat" isometric tile (which you could say is facing upwards), vn.x = 0, vn.y = 0, vn.z = 1.
Is it sensible to do this with the other triangle and then do some sort of comparison to work out if they both fully represent the quadrilateral, or am I way off?
EDIT: I think that I might be doing this ALLLLL wrong!
In essence, defining a tile by only its 4 vertices gives rise to the following:-
http://www.imalarkey.org.uk/images/isotiles.png
Both of these are valid. What I want to know is how should I differentiate between them? Is there a situation where I would need one over the other?