VB Code:
Private Sub MakeTriangles()
Tri = (txtFaces.Text * 1) 'Do Mathmatics
Tri = (Tri - 1)
TriangleNumber = 0
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Dim E As Integer
Dim F As Integer
A = 0
B = 1
C = 2
D = 0
E = 2
F = 3
For Counter3 = 0 To Tri
Debug.Print Ahex
Ahex = "0x" & String(8 - Len(Hex(Ahex)), "0") & Hex(A)
Bhex = "0x" & String(8 - Len(Hex(Bhex)), "0") & Hex(B)
Chex = "0x" & String(8 - Len(Hex(Chex)), "0") & Hex(C)
Dhex = "0x" & String(8 - Len(Hex(Dhex)), "0") & Hex(D)
Ehex = "0x" & String(8 - Len(Hex(Ehex)), "0") & Hex(E)
Fhex = "0x" & String(8 - Len(Hex(Fhex)), "0") & Hex(F)
txtoutput.Text = txtoutput.Text & vbCrLf + " word 0x00000000 ;material index Triangle " & TriangleNumber
txtoutput.Text = txtoutput.Text & vbCrLf + " word " & Ahex & ", " & Bhex & ", " & Chex & ", " & " ;vertex indices" & vbCrLf
TriangleNumber = TriangleNumber + 1
txtoutput.Text = txtoutput.Text & vbCrLf + " word 0x00000000 ;material index Triangle " & TriangleNumber
txtoutput.Text = txtoutput.Text & vbCrLf + " word " & Dhex & ", " & Ehex & ", " & Fhex & ", " & " ;vertex indices" & vbCrLf
A = (A + 4)
B = (B + 4)
C = (C + 4)
D = (D + 4)
E = (E + 4)
F = (F + 4)
Next Counter3
End Sub