   Mouse picking with an hexagonal map
  I am creating a game that''s 3d, but it''s really a 3d view of a 2d map (so you can rotate around, zoom in a little).  The 2d map is based on hexagons, like in this picture:ScreenshotNow, There could be thousands of those octagons.  Each one is made up of 6 triangles.  Obviously I can''t show all of them like that.  So I thought of displaying one large quad, and repeat an octagonal texture over it.  This would look practically the same and would fine, except I come upon one problem.I need to be able to "pick" which hexagon the mouse is selecting.  I''m pretty sure I know how to do it if I was rendering each octagon as an object, but that''s terribly slow.  I need to render the map as a repeated octagonal texture, but still be able to pick out which octagon it''s selecting.  Is this possible?  I know I could unproject the mouse and find where it is.. but I don''t know how to figure out what octagon it''s over (rectangle would be easier).  Any suggestions? 
  Your original post is unclear as to whether you''re using hexagons or octogons. I''ll assume hexagons, because I can''t load the screenshot (56K).The first step is definitely to unproject the mouse position to get a ray, and then collide that ray with your ground plane (that will give you the 2D coordinates within your world).After that it''s more of a maths problem. You''ll need to ensure that the point and the hexagons are in the same coordinate space; if thre are 30 hexagonal cells from left to right across the screen, and yet the collision point ranges from 0.0 to 1.0, you''d probably want to multiply by 30 so that the point makes more sense. In the end, though, I think it''ll just be a question of eliminating as many cells as possible through quick inequalities, and then testing the component triangles of the cells that are left. The quick inequalities you can use will dened on the way to are tesselating the hexagons.   Richard "Superpig" Fine    Smoother than a greased baby[TBRF|GP&T|Enginuity1|Enginuity2|Enginuity3|Enginuity4|Enginuity5];  Thanks a lot   I actually stumbled on an article that describes exactly how to do it.ArticleYeah, it''s hexagons, sorry for accidentally saying octagons.  The 6-sided figure.  Anyway, I got it working very quickly with what that article described, yay!  Thanks a lot for your help! 