1.0.11 • Published 12 months ago

cesium-transformer v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
12 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

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.3

12 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago