User Tools

Site Tools


en:tutorials:shaders:hexagongrid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:orx:tutorials:community:sergeig:hexagongrid [2013/05/09 01:18 (11 years ago)] – [Introduction] sergeigen:tutorials:shaders:hexagongrid [2020/08/31 08:51 (4 years ago)] (current) – ↷ Links adapted because of a move operation iarwain
Line 5: Line 5:
 This tutorial demonstrates how to generate hex grid using shaders and how to track hexagon tiles based on the screen coordinate (mouse cursor tracking). This tutorial demonstrates how to generate hex grid using shaders and how to track hexagon tiles based on the screen coordinate (mouse cursor tracking).
  
-{{hexagon_grid_tutorial_screenshot.png?200|Hexagon Grid Tutorial Screenshot}}+{{tutorials:community:sergeig:hexagon_grid_tutorial_screenshot.png?200|Hexagon Grid Tutorial Screenshot}}
  
 The darker hexagon in the left bottom corner of the screenshot above marks the mouse position when screenshot was taken. The darker hexagon in the left bottom corner of the screenshot above marks the mouse position when screenshot was taken.
  
-This tutorial builds on concepts developed in [[en:orx:tutorials:community:sergeig:shadercoordinates|Shader Coordinates Tutorial]]. The enhancement in this tutorial is about more complicated hexagon grid shader and more complicated internal world coordinate system in code behind.+This tutorial builds on concepts developed in [[en:tutorials:shaders:shadercoordinates|Shader Coordinates Tutorial]]. The enhancement in this tutorial is about more complicated hexagon grid shader and more complicated internal world coordinate system in code behind. 
 + 
 +**__NOTE:__** An updated version of this tutorial, that is based on axial/cubial coordinates, can be found at: [[en:tutorials:shaders:hexagongrid2|Hexagon Grid Tutorial (Axial/Cubial Coordinates)]]
 ===== Details ===== ===== Details =====
  
Line 40: Line 42:
 orxConfig_PopSection(); orxConfig_PopSection();
 </code> </code>
 +
 +==== Visualizing Hexagon Parameters ===
 +
 +The code uses variable names based on the image below:
 +
 +{{tutorials:community:sergeig:hex_single-1.png|Hexagon Math}}
  
 ===== Source Code ===== ===== Source Code =====
Line 372: Line 380:
 } }
  
- 
-#ifdef __orxMSVC__ 
- 
-// Here's an example for a console-less program under windows with visual studio 
-int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 
-{ 
-    // Inits and executes orx 
-    orx_WinExecute(Init, Run, Exit); 
-     
-    // Done! 
-    return EXIT_SUCCESS; 
-} 
- 
-#endif // __orxMSVC__ 
 </code> </code>
en/tutorials/shaders/hexagongrid.1368087536.txt.gz · Last modified: 2017/05/30 00:50 (7 years ago) (external edit)