Observed since 20 Oct, 19:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Geographic coordinate transformation library for 3D Tiles with Three.js and React support
A geographic coordinate transformation library for 3D Tiles, providing ECEF (Earth-Centered, Earth-Fixed) coordinate transformations and CESIUM_RTC extension support for Three.js and React applications.
npm install 3dtiles-geo-transform
or
yarn add 3dtiles-geo-transform
import { CesiumRTCPlugin, createTransformMatrix } from '3dtiles-geo-transform';
import { TilesRenderer } from '3d-tiles-renderer';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
// Setup GLTF loader with CESIUM_RTC support
const gltfLoader = new GLTFLoader();
gltfLoader.register((parser) => new CesiumRTCPlugin(parser));
// Create tiles renderer
const tilesRenderer = new TilesRenderer(tilesetUrl);
tilesRenderer.manager.addHandler(/\.gltf$/, gltfLoader);
// Apply geographic transformation
const center = new THREE.Vector3(x, y, z); // ECEF coordinates
const transformMatrix = createTransformMatrix(center);
tilesRenderer.group.applyMatrix4(transformMatrix);
import { TilesetTransformComponent } from '3dtiles-geo-transform';
import { Canvas } from '@react-three/fiber';
function App() {
return (
<Canvas>
<TilesetTransformComponent>
{/* Your 3D Tiles components */}
</TilesetTransformComponent>
</Canvas>
);
}
ecefToLngLat(x, y, z)Convert ECEF coordinates to longitude/latitude/height.
lngLatToEcef(lng, lat, height)Convert longitude/latitude/height to ECEF coordinates.
createTransformMatrix(center)Create a transformation matrix for converting from ECEF to local coordinates.
CesiumRTCPluginGLTFLoader plugin for handling CESIUM_RTC extension.
const plugin = new CesiumRTCPlugin(parser);
TilesetTransformClass for managing 3D tileset transformations.
TilesetTransformComponentReact component that provides transformation context for child components.
This library works with any 3D Tiles dataset that uses:
Compatible with:
Check out the example/ directory for a complete working example using geographic 3D Tiles data.
cd example
npm install
npm start
# Install dependencies
npm install
# Build the library
npm run build
# Run tests
npm test
# Start development mode
npm run dev
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
This library is designed to work with geographic 3D Tiles data from various sources, including government and commercial providers worldwide.
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 19:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c5f47011120426f45890bc72abe842438e8b2478d086104e3e703bcafff8e357