Joint3d-SDK 开发文档
  • 基础构成
  • 地图地形
  • 业务图层
  • 覆盖元素
  • 材质属性
  • 效果动画
  • 实用工具
  • 场景分析
  • 第三方集成
  • English
  • 简体中文
  • 基础构成
  • 地图地形
  • 业务图层
  • 覆盖元素
  • 材质属性
  • 效果动画
  • 实用工具
  • 场景分析
  • 第三方集成
  • English
  • 简体中文
  • 效果动画

    • Joint3d.Weather
      • example
      • creation
      • properties
    • Rain
      • example
      • properties
    • Snow
      • example
      • properties
    • Fog
      • example
      • properties
    • Cloud
      • example
      • properties
    • Joint3d.Effect
      • example
      • creation
      • properties
    • BlackAndWhite
      • example
      • properties
    • Bloom
      • example
      • properties
    • Brightness
      • example
      • properties
    • DepthOfField
      • example
      • properties
    • LensFlare
      • example
      • properties
    • Night
      • example
      • properties
    • Silhouette
      • example
      • properties
    • Animation
      • methods
    • Joint3d.AroundPoint
      • example
      • creation
    • Joint3d.AroundView
      • example
      • creation
    • Joint3d.CircleScan
      • example
      • creation
    • Joint3d.Flying
      • example
      • creation
      • properties
      • methods
    • Joint3d.GlobeRotate
      • example
      • creation
    • Joint3d.RadarScan
      • example
      • creation
    • Joint3d.RoamingController
      • example
      • creation
      • methods
    • Joint3d.RoamingPath
      • example
      • creation
      • properties
    • Joint3d.KeyboardRoaming
      • example
      • creation
      • properties
    • Joint3d.TrackController
      • example
      • creation
      • methods
    • Joint3d.Track
      • example
      • creation
      • properties
      • methods
  • zh
  • effect
2022-01-10
目录

效果动画

# 效果动画

在三维场景中添加动态要素,让场景能够动起来,更加贴近真实世界的运行

# Joint3d.Weather

天气效果

# example

let weather = new Joint3d.Weather()
viewer.use(weather)

# creation

  • constructor()

    构造函数

    • 返回值 weather

# properties

  • {Rain} rain:雨天 readonly
  • {Snow} snow:雪天 readonly
  • {Fog} snow:雾天 readonly
  • {Cloud} cloud:云 readonly

# Rain

雨天效果

# example

viewer.weather.rain.enable = true
viewer.weather.rain.speed = 2

# properties

  • {Boolean} enable:是否启用
  • {Number} speed:速度

# Snow

雪天效果

# example

viewer.weather.snow.enable = true
viewer.weather.snow.speed = 2

# properties

  • {Boolean} enable:是否启用
  • {Number} speed:速度

# Fog

雾天效果

# example

viewer.weather.fog.enable = true
viewer.weather.fog.fogColor = Joint3d.Color.BLACK

# properties

  • {Boolean} enable:是否启用
  • {Color} fogColor:颜色,
  • {Object} fogByDistance:距离可见,默认: { near: 10, nearValue: 0, far: 2000, farValue: 1.0 }

# Cloud

云效果

# example

viewer.weather.cloud.enable = true
viewer.weather.cloud.rotateAmount = 0.02

# properties

  • {Boolean} enable:是否启用
  • {Number} rotateAmount:移动增量,可为负数

# Joint3d.Effect

效果类

# example

let effect = new Joint3d.Effect()
viewer.use(effect)

# creation

  • constructor()

    构造函数

    • 返回值 effect

# properties

  • {BlackAndWhite} blackAndWhite:黑白 readonly
  • {Bloom} bloom:泛光 readonly
  • {Brightness} brightness:明亮 readonly
  • {DepthOfField} depthOfField:景深 readonly
  • {LensFlare} lensFlare:镜头耀斑 readonly
  • {Night} night:夜视 readonly
  • {Silhouette} silhouette:描边 readonly

# BlackAndWhite

黑白效果

# example

viewer.effect.blackAndWhite.enable = true

# properties

  • {Boolean} enable:是否启用
  • {Number} gradations:强度
  • {Array} selected:设置后期作用的覆盖物

# Bloom

泛光效果

# example

viewer.effect.bloom.enable = true

# properties

  • {Boolean} enable:是否启用
  • {Number} contrast:对比度
  • {Number} brightness:亮度
  • {Number} glowOnly:只发光
  • {Number} delta:Delta
  • {Number} sigma:Sigma
  • {Number} stepSize:StepSize
  • {Array} selected:设置后期作用的覆盖物

# Brightness

明亮效果

# example

viewer.effect.brightness.enable = true

# properties

  • {Boolean} enable:是否启用
  • {Number} intensity:强度
  • {Array} selected:设置后期作用的覆盖物

# DepthOfField

景深效果

# example

viewer.effect.depthOfField.enable = true

# properties

  • {Boolean} enable:是否启用
  • {Number}} focalDistance:焦距
  • {Number} delta:Delta
  • {Number} sigma:Sigma
  • {Number} stepSize:StepSize
  • {Array} selected:设置后期作用的覆盖物

# LensFlare

镜头耀斑效果

# example

viewer.effect.lensFlare.enable = true

# properties

  • {Boolean} enable:是否启用
  • {Number}} intensity:强度
  • {Number} distortion:扭曲度
  • {Number} dirtAmount:分散度
  • {Number} haloWidth:光圈宽度
  • {Array} selected:设置后期作用的覆盖物

# Night

夜视效果

# example

viewer.effect.night.enable = true

# properties

  • {Boolean} enable:是否启用
  • {Array} selected:设置后期作用的覆盖物

# Silhouette

描边效果

# example

viewer.effect.silhouette.enable = true

# properties

  • {Boolean} enable:是否启用
  • {Color} color:颜色
  • {Number} length:长度
  • {Array} selected:设置后期作用的覆盖物

# Animation

场景动画基类

注意

该类无法实例化

# methods

  • start()

    开始动画

    • 返回值 this
  • stop()

    停止动画

    • 返回值 this

# Joint3d.AroundPoint

点位环绕,继承于Animation

# example

let aroundPoint = new Joint3d.AroundPoint(viewer, '120.121, 31.12')
aroundPoint.start()

# creation

  • constructor(viewer,position,[options])

    构造函数

    • 参数
      • {Viewer} viewer:3D 场景
      • {Position|String|Array} position:点位
      • {Object} options:options
    • 返回值 aroundPoint
//options(optional)
{
  "heading": 0, //偏移角度
  "pitch": 0, //翻转角度
  "range": 0, //距离
  "duration": 0, //间隔,单位:秒,当此值大于0时,callback才会生效
  "callback": null, //完成回调函数
  "context": null //回调函数执行上下文
}

# Joint3d.AroundView

相机环绕,继承于Animation

# example

let aroundView = new Joint3d.AroundView(viewer)
aroundView.start()

# creation

  • constructor(viewer,[options])

    构造函数

    • 参数
      • {Viewer} viewer:3D 场景
      • {Object} options:options
    • 返回值 aroundView
//options(optional)
{
  "heading": 0, //偏移角度
  "pitch": 0, //俯仰角度
  "roll": 0, //翻转角度
  "duration": 0, //间隔,单位:秒,当此值大于0时,callback才会生效
  "callback": null, //完成回调函数
  "context": null //回调函数执行上下文
}

# Joint3d.CircleScan

扫描圈,继承于Animation

# example

let circleScan = new Joint3d.CircleScan(viewer, '120, 20', 200)
circleScan.start()

# creation

  • constructor(viewer,position,radius,options)

    构造函数

    • 参数
      • {Viewer} viewer:场景
      • {Joint3d.Position} position:位置
      • {Number} radius:半径
      • {Object} options:属性
    • 返回值 circleScan
// 属性参数(optional)
{
  "color": Joint3d.Color.BLUE, // 颜色
  "speed": 5 // 速度
}

# Joint3d.Flying

定点巡航,继承于Animation

# example

let flying = new Joint3d.Flying(viewer)
flying.positions = ['121.234,21.212,0,-29', '121.435,21.212,0,-29']
flying.start()

# creation

  • constructor(viewer,[options])

    构造函数

    • 参数
      • {Viewer} viewer:场景
      • {Object} options:options
    • 返回值 flying
// 属性参数(optional)
{
  "loop": false, //是否循环,
  "dwellTime": 3, //驻留时间
  "callback": null //回调函数
}

# properties

  • {Array} positions:点位
  • {Array} durations:每个点位的飞行间隔时间,当数组长度为 1 时,每个间隔时间相同,如果不为 1 时,长度必须和点位长度相等

# methods

  • start()

    开始动画

    • 返回值 this
  • pause()

    暂停

    • 返回值 this
  • restore()

    继续

    • 返回值 this

# Joint3d.GlobeRotate

地球自转,继承于Animation

# example

let globeRotate = new Joint3d.GlobeRotate(viewer, {
  duration: 5,
  speed: 1000,
  callback: () => {},
})
globeRotate.start()

# creation

  • constructor(viewer,[options])

    构造函数

    • 参数
      • {Joint3d.Viewer} viewer:3D 场景
      • {Object} options:options
    • 返回值 globeRotate
//options(optional)
{
  "speed": 12 * 1000, //速度
  "duration": 0, //持续时间,当此值大于0时,callback才会生效
  "callback": null, //执行完成的回调函数
  "context": null //回调函数执行上下文
}

# Joint3d.RadarScan

雷达扫描,继承于Animation

# example

let radarScan = new Joint3d.RadarScan(viewer, '120, 20', 200)
radarScan.start()

# creation

  • constructor(viewer,position,radius,options)

    构造函数

    • 参数
      • {Viewer} viewer:场景
      • {Joint3d.Position} position:位置
      • {Number} radius:半径
      • {Object} options:属性
    • 返回值 radarScan
// 属性参数(optional)
{
  "color": Joint3d.Color.BLUE, // 颜色
  "speed": 5 // 速度
}

# Joint3d.RoamingController

漫游控制

# example

let rc = new Joint3d.RoamingController(viewer)

# creation

  • constructor(viewer)

    构造函数

    • 参数
      • {Viewer} viewer:3D 场景
    • 返回值 roamingController

# methods

  • addPath(path)

    添加路径

    • 参数
      • {RoamingPath} path:路径
    • 返回值 this
  • addPaths(paths)

    添加路径数组

    • 参数
      • {Array<RoamingPath>} paths:路径数组
    • 返回值 this
  • removePath(path)

    移除路径

    • 参数
      • {RoamingPath} path:路径
    • 返回值 path
  • getPath(id)

    根据唯一标识获取路径

    • 参数
      • {String} id:唯一标识
    • 返回值 path
  • getPaths()

    获取所有路径

    • 返回值 array
  • activate(path, viewOption)

    激活漫游

    • 参数
      • {RoamingPath} path:路径
      • {String} viewOption:漫游参数
    • 返回值 this
// 漫游参数(可选)
{
  "pitch": 0, // 俯仰角
  "range": 1000 // 距离
}
  • deactivate()

    结束漫游

    • 返回值 this
  • clear()

    移除所有路径

    • 返回值 this

# Joint3d.RoamingPath

漫游路径

# example

let path = new Joint3d.RoamingPath('120.121,32.1213;121.132,32.1213', 20)
rc.addPath(path)

# creation

  • constructor(positions, duration, [pathMode])

    构造函数

    • 参数
      • {String|Array<Position|Number|String|Object>} positions:坐标串
      • {Number} duration:间隔时间,单位:秒
      • {String} pathMode:路径模式:speed(匀速) / time(等时)
    • 返回值 roamingPath

# properties

  • {String} pathId:唯一标识 readonly
  • {String} id:业务唯一标识
  • {String|Array<Position|Number|String>} positions:坐标串
  • {Number} duration:间隔时间,单位:秒
  • {String} pathMode:路径模式:speed(匀速) / time(等时)
  • {String} state:状态 readonly

# Joint3d.KeyboardRoaming

键盘漫游

# example

let kr = new Joint3d.KeyboardRoaming(viewer)
kr.enable = true

# creation

  • constructor(viewer)

    构造函数

    • 参数
      • {Viewer} viewer:3D 场景
    • 返回值 keyboardRoaming

# properties

  • {Boolean} enable:是否启用
  • {Number} moveRate:移动变化率:100
  • {Number} rotateRate:旋转变化率:0.01

# Joint3d.TrackController

历史轨迹控制

# example

let tc = new Joint3d.TrackController(viewer)

# creation

  • constructor(viewer)

    构造函数

    • 参数
      • {Viewer} viewer:3D 场景
    • 返回值 trackController

# methods

  • addTrack(track)

    添加轨迹

    • 参数
      • {Track} track:轨迹
    • 返回值 this
  • addTracks(tracks)

    添加轨迹数组

    • 参数
      • {Array<Track>} tracks:轨迹数组
    • 返回值 this
  • removeTrack(track)

    移除轨迹

    • 参数
      • {Track} track:轨迹
    • 返回值 path
  • getTrack(id)

    根据业务唯一标识获取轨迹

    • 参数
      • {String} id:业务唯一标识
    • 返回值 track
  • getTracks()

    获取所有轨迹

    • 返回值 array
  • play()

    播放

    • 返回值 this
  • pause()

    暂停

    • 返回值 this
  • restore()

    继续播放

    • 返回值 this
  • changeSpeed(speed)

    改变播放速度

    • 参数
      • {Number} speed:速度
    • 返回值 this
  • viewTrack(track, viewOption)

    跟踪某一条路径

    • 参数
      • {Track} track:路径
      • {String} viewOption:配置信息
    • 返回值 this
// 属性参数(可选)
{
  "mode": null, // 视角模式:Joint3d.TrackViewMode
  "pitch": 0, // 俯仰角,第一视角有效
  "range": 1000 // 距离
}
  • releaseTrack(track)

    取消跟踪某一条轨迹

    • 参数
      • {Track} track:路径
    • 返回值 this
  • clear()

    移除所有路径

    • 返回值 this

# Joint3d.Track

轨迹

# example

let track = new Joint3d.Track('120.121,32.1213;121.132,32.1213', 20)
rc.addTrack(track)

# creation

  • constructor(positions, duration, [callback], [options])

    构造函数

    • 参数
      • {String|Array<Position|Number|String|Object>} positions:坐标串
      • {Number} duration:间隔时间,单位:秒
      • {Function} callback:每一个点位到达回调函数,参数有:position(位置信息),isLast(是否为最后的点位)
      • {Object} options: 配置参数
    • 返回值 track
//配置参数(可选)
{
  "clampToGround": false, // 是否贴地
  "clampToTileset": false, // 是否贴物
  "interpolationType": "Linear", // 插值类型:Linear、Hermite、Lagrange
  "interpolationDegree": 2, // 插值度数
  "endDelayTime": 0.5 // 结束时间延长时间,单位:秒
}

# properties

  • {String} trackId:唯一标识 readonly
  • {String} id:业务唯一标识
  • {String|Array<Position|Number|String|Object>} positions:坐标串
  • {Number} duration:间隔时间,单位:秒
  • {Date} startTime:开始时间,设置后会独立于控制器的开始时间
  • {String} state:状态 readonly

# methods

  • addPosition(position,duration)

    添加点位

    • 参数
      • {Position|Array|String|Object} position:点位
      • {Number} duration:间隔,单位:秒
    • 返回值 this
  • setModel(modelUrl,style)

    设置模型

    • 参数
      • {String} modelPath:模型路径
      • {Object} style:样式,详情参考:Joint3d.Model
    • 返回值 this
  • setBillboard(icon,style)

    设置图标

    • 参数
      • {String} icon:图标路径
      • {Object} style:样式,参考:Joint3d.Billboard
    • 返回值 this
  • setLabel(text,style)

    设置文本

    • 参数
      • {String} text:文本
      • {Object} style:样式,参考:Joint3d.Label
    • 返回值 this
  • setPath(visible,style)

    设置路径

    • 参数
      • {Boolean}} visible:是否可见
      • {Object} style:样式,参考:Joint3d.Polyline
    • 返回值 this
Copyright © 2021-2022 厦门集恩图造信息科技股份有限公司
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式