@anov/cesium-three
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

cesium-three

1、安装

NPM / YARN 的方式安装。

npm i @anov/3d-core
npm i @anov/cesium-three
-------------------------
yarn add @anov/3d-core
yarn add @anov/cesium-three

安装后在相关使用文件中引入使用即可

import * as ANOVMAP from "@anov/cesium-three";
import {
  PerspectiveCamera,
  WebGLRenderer,
  Scene,
  OrbitControls
} from "@anov/3d-core";

2、配置alias

(暂时需要,后续升级版本后则无需配置) 下面是vite中配置实例,其他同理

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@anov/3d-core': path.resolve(__dirname, './node_modules/@anov/3d-core/dist'),
    }
  },
})

3、快速上手

//3D
const sceneControl = new SceneControl({
    rendererOps: {
        antialias: true,
        logarithmicDepthBuffer: true,
        shadowMap: true
    },
    orbitControls: false,
    defCameraOps: {
        position: new Vector3(0, 800, 1000),
        fov: 60,
        aspect: window.innerWidth / window.innerHeight,
        near: 0.001,
        far: 10000000
    }
});
sceneControl.render(document.querySelector('#container')!)
//GIS
const scene = sceneControl.scene;
const camera = sceneControl.camera;
const renderer = sceneControl.renderer;
const mapViewer = new Viewer('container', {
    threeModule: {
        scene, camera, renderer
    },
    origin: [121.462, 31.162, 0],
    imageryProvider: new TdtImageryTileProvider({
        style: "aerial",
        requestTileImageInWorker: false,
    })
});
camera.lookAt(new Vector3(0, 0, 0))

Readme

Keywords

none

Package Sidebar

Install

npm i @anov/cesium-three

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

930 kB

Total Files

254

Last publish

Collaborators

  • dubi_mm
  • dafeige811
  • anovcreator
  • npmvictory
  • shenliyang
  • wuyax
  • xhalso
  • zhouzhiguo
  • zhs0417
  • zhanghaifeng132
  • gongking
  • zhu18
  • rxj_2008
  • god_meng
  • xingw