Commit 148d4b74 by jlc

update:机械臂和实时驱动案例的修改

parent fe7e0488
src/assets/RobotArmAnimation.png

197 KB | W: | H:

src/assets/RobotArmAnimation.png

812 KB | W: | H:

src/assets/RobotArmAnimation.png
src/assets/RobotArmAnimation.png
src/assets/RobotArmAnimation.png
src/assets/RobotArmAnimation.png
  • 2-up
  • Swipe
  • Onion skin
export function addRobotArmAnimation(viewer) { export function addRobotArmAnimation(viewer) {
const czml = [ const czml = [
{ {
id: "document", id: "document",
name: "robotArm", name: "CZML Model",
version: "1.0", version: "1.0",
clock: { clock: {
interval: "2019-08-28T04:00:00Z/2019-08-28T04:20:00Z", interval: "2015-01-01T00:00:00Z/2015-01-01T00:00:20Z",
currentTime: "2019-08-28T04:00:00.00Z", currentTime: "2015-01-01T00:00:00Z",
multiplier: 1, multiplier: 20,
range: "LOOP_STOP", },
step: "SYSTEM_CLOCK_MULTIPLIER"
}
}, },
{ {
id: "robotArm", id: "model",
name: "robotArmAnimation", position: {
description: "<p>this is a ship</p>", cartographicDegrees: [120, 30, 100000],
availability: "2019-08-28T04:00:00Z/2019-08-28T04:20:00Z", },
position: { viewFrom: {
cartographicDegrees: [120, 30, 0] cartesian: [4.3, 0.1, 2.6],
},
model: {
gltf: "https://raw.githubusercontent.com/jinlinchao123/Cesium-assets/main/3Dmodel/Cesium_Man.glb",
runAnimations: false,
nodeTransformations: {
Skeleton_arm_joint_L__3_: {
rotation: {
epoch: "2015-01-01T00:00:00Z",
unitQuaternion: [
0,
-0.23381920887303329,
-0.6909886782144156,
-0.0938384854833712,
0.6775378681547408,
10,
-0.4924076887347565,
-0.6304934596091216,
0.20657864059632378,
0.563327551886459,
20,
-0.23381920887303329,
-0.6909886782144156,
-0.0938384854833712,
0.6775378681547408,
],
},
},
Skeleton_arm_joint_R__2_: {
rotation: {
unitQuaternion: [
-0.2840422631464792,
-0.40211904424847345,
0.25175867757399086,
0.7063888981321548,
],
},
},
}, },
model: { },
show: true,
gltf: [
{
interval: "2019-08-28T04:00:00Z/9999-12-31T23:59:59.9999999Z",
uri: 'https://raw.githubusercontent.com/jinlinchao123/Cesium-assets/main/3Dmodel/Station.glb'
}
],
minimumPixelSize: 128,
scale: 1,
runAnimations: true
}
}, },
]; ];
var dataSourcePromise = viewer.dataSources.add(Cesium.CzmlDataSource.load(czml)); var dataSourcePromise = viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));
dataSourcePromise.then(function (dataSource) { dataSourcePromise.then(function(dataSource) {
// 根据模型所在的实体去进行加载 // 根据模型所在的实体去进行加载
viewer.trackedEntity = dataSource.entities.getById('robotArm'); viewer.trackedEntity = dataSource.entities.getById('model');
}).catch(function (error) { }).catch(function(error) {
console.error(error); console.error(error);
}); });
} }
...@@ -42,7 +42,7 @@ export const elementMovingMap = { ...@@ -42,7 +42,7 @@ export const elementMovingMap = {
}, },
实时驱动: { 实时驱动: {
title: '实时驱动', title: '实时驱动',
pngUrl: '/src/assets/RobotArmAnimation.png' pngUrl: '/src/assets/RealTimeDriver.png'
}, },
坐标轴: { 坐标轴: {
title: '坐标轴', title: '坐标轴',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment