Jump to content
  • Advertisement
Sign in to follow this  
Psychopathetica

Triangle Strip Issue With A Square

This topic is 2547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm basically rendering 4 squares within a square using TriangleStrip. One of the squares has a point that's being transformed and rotated. But besides that, assuming there is no transformation at all, the issue is rendering 4 squares within a square. I can only render 2 squares so far since the Triangles connect

Vertex_List2(0) = Create_TLVertex(50, 0, 0, 1, Color, 0, 0, 0)
Vertex_List2(1) = Create_TLVertex(100, 0, 0, 1, Color, 0, 0, 0)
Vertex_List2(2) = Create_TLVertex(50, 50, 0, 1, Color, 0, 0, 0) 'CENTER OF ENTIRE SQUARE
Vertex_List2(3) = Create_TLVertex(100, 0, Y, 0, 1, Color, 0, 0, 0)
Vertex_List2(4) = Create_TLVertex(50, 100, 0, 1, Color, 0, 0, 0)
Vertex_List2(5) = Create_TLVertex(100, 100, 0, 1, Color, 0, 0, 0)
Vertex_List2(6) = Create_TLVertex(100, 50, 0, 1, Color, 0, 0, 0)


And this makes 4 nice triangles (2 squares). As for the other 2 which should complete the square, it doesn't connect. Im needing vertices (0, 0), (50, 0), (0, 50), (50, 50), (0, 100), and (50, 100). Also of the 4 square that need drawn, square #2 must be first (top right square) How can I do this without resortng to using a Trianglelist? Thanks in advance. Hopefully the solution is simple. It has something to do with the order of my vertices.

Share this post


Link to post
Share on other sites
Advertisement
Hi!

If you use an index buffer you can specify the special index 0xffff (16 bit) or 0xffffffff (32 bit) to tell the graphics card to start a new triangle strip. This way you can draw multiple strips that are independent from each other in a single draw call. This is mentioned here.

That should make things easier. :)

Share this post


Link to post
Share on other sites
I'd personally recommend junking strips and using a triangle list with an index buffer. Read this: http://tomsdxfaq.blogspot.com/2005_12_01_archive.html#113546220006246490

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!