1.0.11 • Published 11 months ago

cesium-transformer v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Cesium Transformer

A powerful npm package built on top of Cesium, enabling advanced geometric transformations for Model, Primitive, and Cesium3DTileset.

Installation

Install the package via npm:

npm install cesium-transformer

Install the package via pnpm:

pnpm install cesium-transformer

Usage

  • Transformer({viewer, element, boundingSphere})

    • Applies a geometric transformation to the specified element in the Cesium scene.

    • Parameters:

      • viewer (Cesium.Viewer): The Cesium Viewer instance where the transformation will be applied.
      • element (Cesium.Model, Cesium.Primitive, Cesium.Cesium3DTileset): The target element to be transformed. This can be a model, primitive, or 3D tileset.
      • boundingSphere (Cesium.BoundingSphere): The bounding sphere that defines the area of the element that will be transformed.
    • Example:

      import Transformer from 'cesium-transformer';
      
      const boundingSphere = new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), 1000);
      
      const transformer = new Transformer({
        viewer, element, boundingSphere
      });

      translation rotation scale

    • functions

      • changeMode(mode)

        • Changes the current transformation mode to either 'translate', 'rotate', or 'scale'.

        • Parameters:

          • mode (string): The transformation mode to switch to. Accepted values are 'translation', 'rotation', and 'scale'.
        • Example:

           transformer.changeMode('translation');  // Switches to translation mode
           transformer.changeMode('rotation');  // Switches to rotation mode
           transformer.changeMode('scale');   // Switches to scaling mode
      • destory

        • destory the transformer

        • Example:

           transformer.destory()
1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.3

11 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago