|
-
Dec 1st, 2001, 09:36 AM
#1
Thread Starter
Hyperactive Member
Loops Sort of....
Hey just me again with my slight problem
I need a loop to do something like this
word 0x00000000 ;material index Triangle 0
word 0x00000000, 0x00000001, 0x00000002 ;vertex indices
word 0x00000000 ;material index Triangle 1
word 0x00000000, 0x00000002, 0x00000003 ;vertex indices
word 0x00000000 ;material index Triangle 2
word 0x00000004, 0x00000005, 0x00000006 ;vertex indices
word 0x00000000 ;material index Triangle 3
word 0x00000004 0x00000006, 0x00000007 ;vertex indices
my code is this so far
VB Code:
Private Sub MakeTriangles()
Dim Counter3 As Integer
Dim Tri As Integer
Dim TriNumber As Integer
Tri = (txtFaces.Text * 2) 'Do Mathmatics
Tri = (Tri - 1)
TriangleNumber = 0
For Counter3 = 0 To Tri ' Set up 10 repetitions.
txtoutput.Text = txtoutput.Text & vbCrLf + "word 0x00000000 ;material index Triangle " & TriangleNumber
txtoutput.Text = txtoutput.Text & vbCrLf + "word 0x00000000, 0x00000001, 0x00000002 ;vertex indices" & vbCrLf
TriangleNumber = TriangleNumber + 1
Next Counter3
End Sub
Which results in.....
word 0x00000000 ;material index Triangle 0
word 0x00000000, 0x00000001, 0x00000002 ;vertex indices
word 0x00000000 ;material index Triangle 1
word 0x00000000, 0x00000001, 0x00000002 ;vertex indices
word 0x00000000 ;material index Triangle 2
word 0x00000000, 0x00000001, 0x00000002 ;vertex indices
word 0x00000000 ;material index Triangle 3
word 0x00000000, 0x00000001, 0x00000002 ;vertex indices
as you can see from the top segment of triangles
but how can i go about implementing it so it does it this way
so that it does the Values
like in the top one
so it can count up them
i dont know how to make the first one only change after its done 2 of the same
its hard to explain
basicaly i need my program to replacate whats in the top lot
we have got the formatting sorted so it can count in normal numbers
then i can change it for when it prints the results
as i say its hard to explain....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|