<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Game Algorithms</title><link>http://forums.xna.com/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Suggestions How To Render Hexagon Grid</title><link>http://forums.xna.com/forums/thread/194662.aspx</link><pubDate>Mon, 29 Jun 2009 20:53:03 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:194662</guid><dc:creator>Goss</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/194662.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=194662</wfw:commentRss><description>Here an update on my hexagon grid. It&amp;#39;s coming along quite well. &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.youtube.com/watch?v=xDCo83JlMMg"&gt;http://www.youtube.com/watch?v=xDCo83JlMMg&lt;/a&gt;</description></item><item><title>Re: Suggestions How To Render Hexagon Grid</title><link>http://forums.xna.com/forums/thread/187585.aspx</link><pubDate>Tue, 09 Jun 2009 06:51:18 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:187585</guid><dc:creator>sking500</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/187585.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=187585</wfw:commentRss><description>&lt;span style="background-color:#f4f7f5;"&gt;I&amp;#39;ve done something similar in the past where each hex contained a unique texture.  I treated the hex &amp;quot;grid&amp;quot; as no different from a square/rectangular grid...the only difference is that every other row is offset one-half the &amp;quot;short&amp;quot; width (i.e. side-to-side width as opposed to corner-to-corner width) of the hex.&lt;br /&gt;
&lt;br /&gt;
I setup a Hex object that contained Vector array to form a square indicating the position/size of each hex and overlayed each hex&amp;#39;s texture on the square.  Fortuantely this made hit testing REALLY easy.  All I had to do was test the squares that were intersected, then use a single black-and-white &amp;quot;hit test&amp;quot; bitmap by mapping the &amp;quot;hit&amp;quot; location (point where ray intersects hex square) to the corresponding local coordinate on the hit texture and getting the color (black = miss, white = hit).&lt;br /&gt;
&lt;br /&gt;
However, if it&amp;#39;s not necessary to render the tiles individually, but merely map a hexagon tile to a location on a larger &amp;quot;map&amp;quot; texture you can draw the map using fewer textures, and get the selected hex using some simple division and the same &amp;quot;hit test&amp;quot; image technique.  To draw the hex border, you&amp;#39;d store a single texture and overlay location where it should be drawn on top of the larger map texture(s).&lt;br /&gt;
&lt;/span&gt;</description></item><item><title>Re: Suggestions How To Render Hexagon Grid</title><link>http://forums.xna.com/forums/thread/187525.aspx</link><pubDate>Tue, 09 Jun 2009 01:54:04 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:187525</guid><dc:creator>Goss</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/187525.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=187525</wfw:commentRss><description>Awesome thanks guys. &lt;br /&gt;</description></item><item><title>Re: Suggestions How To Render Hexagon Grid</title><link>http://forums.xna.com/forums/thread/187452.aspx</link><pubDate>Mon, 08 Jun 2009 22:45:11 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:187452</guid><dc:creator>Kamilyon</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/187452.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=187452</wfw:commentRss><description>forgot to mention.&lt;br /&gt;
I found the biggest challenge in creating a hexagonal grid system was knowing what position to put ech hex-cell&lt;br /&gt;
There are several articles around the web that address it, depending on your specific needs.&lt;br /&gt;
Or if you have a nack for trig. you will be able to figure it out yourself (which is a nice exercise)&lt;br /&gt;
&lt;br /&gt;
Failing that here is one to start you off:&lt;br /&gt;
&lt;a href="http://www.drking.plus.com/hexagons/index.html"&gt;http://www.drking.plus.com/hexagons/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Do a search on &amp;quot;hexagon grid&amp;quot; or &amp;quot;hexagon map&amp;quot; to find more resources :)&lt;br /&gt;</description></item><item><title>Re: Suggestions How To Render Hexagon Grid</title><link>http://forums.xna.com/forums/thread/187451.aspx</link><pubDate>Mon, 08 Jun 2009 22:32:16 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:187451</guid><dc:creator>Kamilyon</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/187451.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=187451</wfw:commentRss><description>I have done it a couple different ways depending on my need at the time.&lt;br /&gt;
&lt;br /&gt;
If you want to control each hex-cell&amp;#39;s texture independently then using the instancing approach is one of the better:&lt;br /&gt;
&lt;br /&gt;
Create 1 mesh/model of the hex you want.&lt;br /&gt;
Then looping thru your grid array, render the mesh with its new position and/or texture.&lt;br /&gt;
&lt;br /&gt;
This is from an old project (i really need to get back on someday...)&lt;br /&gt;
&lt;a href="http://img132.imageshack.us/img132/9416/hexgrid1.png"&gt;http://img132.imageshack.us/img132/9416/hexgrid1.png&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have also created a single (very large) mesh containing all of the vertices/indexbuffer/normals etc... on top of which I draw one big(bigger) texture.&lt;br /&gt;
but that was for a different purpose.&lt;br /&gt;
&lt;br /&gt;
If it is for an overlay ontop of another terrain system you can have (precreated or dynamically rendered) a texture holdin the hex grid you want and Project it on to the surface.&lt;br /&gt;
&lt;br /&gt;
cheers,&lt;br /&gt;</description></item><item><title>Re: Suggestions How To Render Hexagon Grid</title><link>http://forums.xna.com/forums/thread/187432.aspx</link><pubDate>Mon, 08 Jun 2009 21:22:50 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:187432</guid><dc:creator>Kyle W</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/187432.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=187432</wfw:commentRss><description>My suggestion would be to have a single hexagon model and then redraw it as many times as necessary in the desired positions. You can implement semi-transparency in the shader for the model if desired.</description></item><item><title>Suggestions How To Render Hexagon Grid</title><link>http://forums.xna.com/forums/thread/187409.aspx</link><pubDate>Mon, 08 Jun 2009 20:23:11 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:187409</guid><dc:creator>Goss</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/187409.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=187409</wfw:commentRss><description>Before I try to attempt how to render such thing. I was wondering what your guys suggestion on how to render a hexagon grid. Here an example from the game King&amp;#39;s Bounty.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://img146.imageshack.us/img146/315/kingsbountythelegend200.jpg"&gt;http://img146.imageshack.us/img146/315/kingsbountythelegend200.jpg&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Should I render an array with each element that stores a Vector position. Then loop the array and draw a single hexagon??&lt;br /&gt;</description></item></channel></rss>