mwg API
    Preparing search index...

    Function gridPoint3D

    • Converts the framework's integer square or odd-q hex coordinate to 3D world space.

      Parameters

      • shape: GridShape3D
      • x: number
      • y: number
      • tileSize: number = 1
      • height: number = 0
      • heightStep: number = 1

      Returns Point3D

      import { gridPoint3D } from '@datamoc/mwg/3d';

      //cell (3, 2), one level up, on a grid of 2-unit tiles with 0.5-unit levels
      const point = gridPoint3D('square', 3, 2, 2, 1, 0.5);
      console.log(point); // { x: 6, y: 0.5, z: 4 }