这是indexloc提供的服务,不要输入任何密码
Skip to content

jeremyfromearth/hex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HEX

Hexagonal grids for C++

This library provides only hexagon related computations and is renderer agnostic. The examples below have been rendered using Cinder.

Creation, addition & subtraction

l = hex::layout::hexagonal(6);

demo 1

l -= hex::layout::hexagonal(3);

demo 2

l += hex::layout::parallelogram(10, 10, layout::options::vertical);

demo 3

l += hex::layout::parallelogram(10, 10, layout::options::standard);

demo 4

l -= hex::layout::hexagonal(3);

demo 5

l += hex::layout::hexagonal(1);

demo 6

Coordinate space conversions

vec2 v = vec2(e.getPos()) - getWindowCenter();
hex::point p(v.x, v.y);
hover = hex::lattice::point_to_cell(p, orientation, radius);

demo 7

References

Red Blob Games: http://www.redblobgames.com/grids/hexagons/

About

Hexagons for C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published