Skip to content

Latest commit

 

History

History

geometry

2D and 3D Geometry Types for JS

npm npm (scoped with tag)

2D and 3D Geometry Types for JS.

Getting Started

Script Tag

The easiest way to use the helpers provided in this package is by including a <script> tag in your HTML file that references our published JS bundles from a CDN. These helpers can then be used in combination with our Viewer SDK to interact with the rendered scene. See the instructions there on getting started to set up a viewer.

<html>
  <head>
  </head>
  <body>
    <script type="module">
      import { Vector3 } from 'https://cdn.jsdelivr.net/npm/@vertexvis/geometry@0.22.0/dist/cdn/bundle.esm.js';

      async function main() {
        const viewer = document.querySelector('#viewer');
        const scene = await viewer.scene();
        const camera = scene.camera();

        await camera.update({
          position: Vector3.create(0, 0, 100),
          lookAt: Vector3.origin(),
          up: Vector3.up(),
        })
        .render();
      }
    </script>
  </body>
</html>