- procedure T3DSMesh.SetConnectivity;
- var
- A1, A2, B1, B2: GLuint;
- ifaceA, ifaceB, edgeA, edgeB: GLuint;
- begin
- for ifaceA := 0 to (FNumIndices div 3)-1 do
- for edgeA := 0 to 2 do
- begin
- Ffaces[ifaceA].neighbour[edgeA] := -1;
- end;
- for ifaceA := 0 to (FNumIndices div 3) -1 do
- for ifaceB := ifaceA + 1 to (FNumIndices div 3) - 1 do
- for edgeA := 0 to 2 do
- if FFaces[ifaceA].neighbour[edgeA] <> 0 then
- for edgeB := 0 to 2 do
- begin
- a1 := Ffaces[ifaceA].vertex[edgeA];
- a2 := Ffaces[ifaceB].vertex[(edgeA+1) mod 3];
- b1 := Ffaces[ifaceA].vertex[edgeB];
- b2 := Ffaces[ifaceB].vertex[(edgeB+1) mod 3];
- if ((a1 = b1) and (a2 = b2)) or ((a1 = b2) and (a2 = b1)) then
- begin
- Ffaces[ifaceA].neighbour[edgeA] := ifaceB;
- Ffaces[ifaceB].neighbour[edgeB] := ifaceA;
- end;
- end;
- end;