Skip to main content
gamedev.net
🔒 Locked

Tristrip problem

Started by Lupin Dec 19, 2002 at 6:48 AM 2 replies 300+ views
Original Post
Lupin
Lupin
I set up an 4x4 tri-strip patch, but there are some extra faces, here is an screenshot to explain my problem (I draw an black border around the extra-faces): http://www.illicitdev.net/~matrixvb/tristripprob.JPG Here is the code (vertices and indicies) I''m using to set up the tristrip:
  

Vertices(0) = MakeVertex2(0, Rnd * 0.5, 0, &HFFFFFFFF, 0, 1)
Vertices(1) = MakeVertex2(1, Rnd * 0.5, 0, &HFFFFFFFF, 0.25, 1)
Vertices(2) = MakeVertex2(0, Rnd * 0.5, 1, &HFFFFFFFF, 0, 0.75)
Vertices(3) = MakeVertex2(1, Rnd * 0.5, 1, &HFFFFFFFF, 0.25, 0.75)
Vertices(4) = MakeVertex2(0, Rnd * 0.5, 2, &HFFFFFFFF, 0, 0.5)
Vertices(5) = MakeVertex2(1, Rnd * 0.5, 2, &HFFFFFFFF, 0.25, 0.5)
Vertices(6) = MakeVertex2(0, Rnd * 0.5, 3, &HFFFFFFFF, 0, 0.25)
Vertices(7) = MakeVertex2(1, Rnd * 0.5, 3, &HFFFFFFFF, 0.25, 0.25)
Vertices(8) = MakeVertex2(0, Rnd * 0.5, 4, &HFFFFFFFF, 0, 0)
Vertices(9) = MakeVertex2(1, Rnd * 0.5, 4, &HFFFFFFFF, 0.25, 0)
Vertices(10) = MakeVertex2(2, Rnd * 0.5, 0, &HFFFFFFFF, 0.5, 1)
Vertices(11) = MakeVertex2(2, Rnd * 0.5, 1, &HFFFFFFFF, 0.5, 0.75)
Vertices(12) = MakeVertex2(2, Rnd * 0.5, 2, &HFFFFFFFF, 0.5, 0.5)
Vertices(13) = MakeVertex2(2, Rnd * 0.5, 3, &HFFFFFFFF, 0.5, 0.25)
Vertices(14) = MakeVertex2(2, Rnd * 0.5, 4, &HFFFFFFFF, 0.5, 0)
Vertices(15) = MakeVertex2(4, Rnd * 0.5, 4, &HFFFFFFFF, 1, 0)
Vertices(16) = MakeVertex2(3, Rnd * 0.5, 4, &HFFFFFFFF, 0.75, 0)
Vertices(17) = MakeVertex2(4, Rnd * 0.5, 3, &HFFFFFFFF, 1, 0.25)
Vertices(18) = MakeVertex2(3, Rnd * 0.5, 3, &HFFFFFFFF, 0.75, 0.25)
Vertices(19) = MakeVertex2(4, Rnd * 0.5, 2, &HFFFFFFFF, 1, 0.5)
Vertices(20) = MakeVertex2(3, Rnd * 0.5, 2, &HFFFFFFFF, 0.75, 0.5)
Vertices(21) = MakeVertex2(4, Rnd * 0.5, 1, &HFFFFFFFF, 1, 0.75)
Vertices(22) = MakeVertex2(3, Rnd * 0.5, 1, &HFFFFFFFF, 0.75, 0.75)
Vertices(23) = MakeVertex2(4, Rnd * 0.5, 0, &HFFFFFFFF, 1, 1)
Vertices(24) = MakeVertex2(3, Rnd * 0.5, 0, &HFFFFFFFF, 0.75, 1)

Indicies(0) = 0
Indicies(1) = 1
Indicies(2) = 2
Indicies(3) = 3
Indicies(4) = 4
Indicies(5) = 5
Indicies(6) = 6
Indicies(7) = 7
Indicies(8) = 8
Indicies(9) = 9
Indicies(10) = 14
Indicies(11) = 9
Indicies(12) = 13
Indicies(13) = 7
Indicies(14) = 12
Indicies(15) = 5
Indicies(16) = 11
Indicies(17) = 3
Indicies(18) = 10
Indicies(19) = 1
Indicies(20) = 10
Indicies(21) = 24
Indicies(22) = 11
Indicies(23) = 22
Indicies(24) = 12
Indicies(25) = 20
Indicies(26) = 13
Indicies(27) = 18
Indicies(28) = 14
Indicies(29) = 16
Indicies(30) = 15
Indicies(31) = 16
Indicies(32) = 17
Indicies(33) = 18
Indicies(34) = 19
Indicies(35) = 20
Indicies(36) = 21
Indicies(37) = 22
Indicies(38) = 23
Indicies(39) = 24

  
Arion
Arion
I get confused woring triangle strips in a grid. I can't see anything obviously wrong, but I have trouble following the blank triangles used for going to the next line.

Your verticies seem to be in a strange fashion. Though I am not qualified to refute why they are setup that way.

08 09 14 16 15
06 07 13 18 17
04 05 12 20 19
02 03 11 22 21
00 01 10 24 23

Defined with your indicies:

00, 01, 02, 03, 04, 05, 06, 07, 08, 09,
14, 09, 13, 07, 12, 05, 11, 03, 10, 01,
10, 24, 11, 22, 12, 20, 13, 18, 14, 16,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24

Is that the proper layout ?


Guy

[edited by - Arion on December 19, 2002 3:57:52 PM]
Lupin
Lupin
no, I don''t think that this is the proper layout, I just tried it out and it seemed to work...
Lupin
Lupin
could anyone please help me an little bit?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.