gomartini

module
v0.0.0-...-2a780f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2023 License: MIT

README

gomartini

a Go port of MARTINI for fast RTIN terrain mesh generation

Installation | Getting Up and Running | Examples | See Also

gomartini is a Go port of Mapbox's Awesome Right-Triangulated Irregular Networks, Improved (MARTINI). The main features are:

  • Real-time terrain mesh generation from height data. Given a (2k+1) × (2k+1) terrain grid, it generates a hierarchy of triangular meshes of varying levels of detail in milliseconds.

Installation

go get github.com/e-k-m/gomarini

Getting Up and Running

# 1. Install mage (see here: https://github.com/magefile/mage)
# 2. Install development tools using
mage -v deps
# 2. See tasks/targets via
mage
# call in project root and then call the ones needed, or just use go tools.

Examples

// set up mesh generator for a certain 2^k+1 grid size
m := martini.New(257)

// generate RTIN hierarchy from terrain data (a slice of 2^k+1^2 length)
tile := m.CreateTile(terrain)

// get a mesh (vertices and triangles indices) for a 5m error
vertices, triangles := tile.GetMesh(5)

See Also

Directories

Path Synopsis
examples
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL