   A couple of 2D in 3D questions
  I have decided to move from DirectDraw to Direct3D for my 2D gaming needs. I have been studying Direct 3d for a few weeks and doing some experiments into what I would prefer to do. I wanted to render my map in hexagons, which made things tricky for me. I ended up rendering them using a triangle fan with eight vertices, which comes out to six primitives.****3  2******4****01/7****5****6(EDIT: Had to put the stars in to keep spacing).Here are my questions:1.) My texture is warping around vertice zero just a little. How can I fix this? Ill provide code at the bottom.2.) Any other recommedations as how to implement and render a hexagon?Comments:-I like the shading effects of the triangle fan, but I cant say its ideal the way I have it. I really like the shading effects implemented in this article: http://www.gamedev.net/reference/articles/article935.asp , but I really want to use hexagons. Any ideas/comments for me pertaining to question one or two?//Texture position//Vertice 0Vertices[y + x + 0].u = 0.50f;Vertices[y + x + 0].v = 0.50f;//Vertice 1Vertices[y + x + 1].u = 0.00f;Vertices[y + x + 1].v = 0.66f;//Vertice 2Vertices[y + x + 2].u = 0.00f;Vertices[y + x + 2].v = 0.33f;//Vertice 3Vertices[y + x + 3].u = 0.50f;Vertices[y + x + 3].v = 0.00f;//Vertice 4Vertices[y + x + 4].u = 1.00f;Vertices[y + x + 4].v = 0.33f;//Vertice 5Vertices[y + x + 5].u = 1.00f;Vertices[y + x + 5].v = 0.66f;//Vertice 6Vertices[y + x + 6].u = 0.50f;Vertices[y + x + 6].v = 1.00f;//Vertice 7Vertices[y + x + 7].u = 0.00f;Vertices[y + x + 7].v = 0.66f;
  Well, you could entirely get rid of vertex 0, and use only 4 triangles in a variety of ways:    O---------O   /|   /|\   / |  / | \  /  |/   |  \ O   |    /    |   O \  |   /|  /  \ | /  | /   \|/   |/    O---------O    O---------O   /|  --_\   / |--_   \  /  |   --_ \ O   | --O \  |   _-- /  \ |_--   /   \|  _--/    O---------O    O---------O   /   --_\   /  --_   \  / --_ \ O-----------------O \ _-- /  \  _--   /   \   _--/    O---------OIf there's still warping, make sure your texture coordinates are as accurate as possible.   ;  I agree with Agony.  You're using .33 and .66, of which adds up to .99.  Try extending the digits out further 0.333333333f for example.Also, wouldn't vertices 2 and 4 be 0.25, or 25% of the way into the texture along the y axis?  And 1, 7, and 5 be 75% of the way into the y axis?  Maybe try 0.25 and 0.75 instead of .33 and .66.Chris   ;  Here's how I ended up doing it:0   1    5 2    430 = (.5, 1)1 = (0, .75)2 = (0, .25)3 = (.5, 0)4 = (1, .25)5 = (1, .75)You use a triangle fan of 4 triangles like so (sorry for my bad ASCII art!): 0    / | \  / / | \ \ 1   | | |   5|  /  |  \  || |   |   | ||/    |    \|2|4  \   |   /    \ | / 3Using .25 and .75 creates the most equilateral hexagon.  You could use .33 and .67 (instead of .66), or any set of values that add to 1, but the sides won't be the same size.Also, if you want to keep spacing without using stars, you can use the html tag <pre>Good luck on your project!;  Thanks very much for the replies. I now realize my mistake about the texture position... I was working on it too much yesturday and my brain turned off :) Ill spend another week experimenting with the triangle positions, I do appreciate the suggestions :)   ;  If you want to use the vertex colours for lighting/shadows, surface colours or pretty much anything, you'll probably find your initial setup (with 6 tris) much easier to work with and give more consistant results. Sure you get a few more tris but for a 2d game thats really not a noticable difference.Also it would be better to do something like 1/3 instead of 0.33. You'll get better accuracy, and the compiler should do it at compile time so it won't cost you anything.   