preface
System analysis
At present, the advanced jet transport all installed flight condition monitoring system, it recorded about parameter values, and stored in a data management device, the data can be sent to or sent to the station after the plane landed, with a special computer program to calculate and correction, make the performance monitoring data gathering, sending, meter Bi analysis automation work, saves the manpower, improved the accuracy.
The implementation process
Moving through the clouds
var i = 1,
p = 0;
setInterval((a)= > {
i -= 0.1; p += 0.005;
clouds.s('shape3d.uv.offset', [i, 0]);
cloudBackground.s('all.uv.offset', [p, 0]);
}, 100);Copy the code
Heave effect
dm.enableAnimation(20);
plane.setAnimation({
back1: {
from: 0.to: 160.easing: 'Cubic.easeInOut'.duration: 8000.next: "up1".onUpdate: function (value) {
value = parseInt(value);
var p3 = this.p3();
this.p3(value, p3[1], p3[2]); }},/ /... Omit the similar
start: ["back1"]});Copy the code
Ball fan Angle limit
Flight after effect is perfect, then I met a more difficult problem, because while looking at the plane is actually in the sea of clouds, but only in flight in the channel, the background is just flat map, so when the Angle of view to some degree will have a strong sense of acosmia and unreality, requires a perspective limit, Get the Angle adjustment just right in range. If you don’t know much about it, you can go to the 3D manual on hightopo’s official website. There are detailed explanations in it. I won’t go into details here. Due to the perspective range, I decided to fix the location of center as follows:
g3d.addPropertyChangeListener(e= > {
// Fix the center point
if (e.property === 'center') {
e.newValue[0] = center[0];
e.newValue[1] = center[1];
e.newValue[2] = center[2]; }}Copy the code
function limitEye(g3d, eye, center, options) {
var limitMaxL = options.limitMaxL,
limitMinL = options.limitMinL,
limitA = options.limitA;
g3d.addPropertyChangeListener(e= > {
// Fix the center point
if (e.property === 'center') {
e.newValue[0] = center[0];
e.newValue[1] = center[1];
e.newValue[2] = center[2];
}
// Restrict the perspective
if (e.property === 'eye') {
var newEyeV = new ht.Math.Vector3(e.newValue),
centerV = new ht.Math.Vector3(center),
refEyeV = new ht.Math.Vector3(eye),
refVector = refEyeV.clone().sub(centerV),
newVector = newEyeV.clone().sub(centerV);
if (centerV.distanceTo(newEyeV) > limitMaxL) {
newVector.setLength(limitMaxL);
e.newValue[0] = newVector.x;
e.newValue[1] = newVector.y;
e.newValue[2] = newVector.z;
}
if (centerV.distanceTo(newEyeV) < limitMinL) {
newVector.setLength(limitMinL);
e.newValue[0] = newVector.x;
e.newValue[1] = newVector.y;
e.newValue[2] = newVector.z;
}
if (newVector.angleTo(refVector) > limitA) {
var oldLength = newVector.length(),
oldAngle = newVector.angleTo(refVector),
refLength = oldLength * Math.cos(oldAngle),
vertVector,
realVector,
realEye;
refVector.setLength(refLength);
newEyeV = newVector.clone().add(centerV);
refEyeV = refVector.clone().add(centerV);
vertVector = newEyeV.clone().sub(refEyeV);
vertLength = refLength * Math.tan(limitA);
vertVector.setLength(vertLength);
realVector = vertVector.clone().add(refEyeV).sub(centerV);
realVector.setLength(oldLength);
realEye = realVector.clone().add(centerV);
// Prevent movement Angle greater than 180 degrees, Angle reversal
if (oldAngle > Math.PI / 2) {
realEye.negate();
}
e.newValue[0] = realEye.x;
e.newValue[1] = realEye.y;
e.newValue[2] = realEye.z; }}})}Copy the code
Aircraft surveillance system
var fitFlowP = function (e) {
if (e.property === 'position' && e.data === plane) {
mapGV.fitData(plane, false); }}; buttonP.s({'interactive': true.'onClick': function (event, data, view, point, width, height) {
map.a('fitDataTag'.'plane2D');
mapGV.fitData(plane, false); mapDM.md(fitFlowP); }}); buttonL.s({'interactive': true.'onClick': function (event, data, view, point, width, height) {
mapDM.umd(fitFlowP);
map.a('fitDataTag'.'flyLine');
mapGV.fitData(flyLine, false); }});/ /... omit
Copy the code
button_JC.s({
'interactive': true.'onClick': function (event, data, view, point, width, height) {
event.preventDefault();
let g3d = G.g3d,
g3dDM = G.g3d.dm();
g3d.fireInteractorEvent({
kind: 'doubleClickData'.data: g3dDM.getDataByTag(data.getTag())
})
}
});
/ /... omit
Copy the code
Sky rendering effect
if ((hour > 6 && hour < 19) || (hour == 6 && minutes >= 30)) {
timePane && timePane.a({
'morning.visible': false.'day.visible': true.'dusk.visible': false.'night.visible': false.'day.opacity': 1
})
skyBox.s({
"shape3d.blend": 'rgb(127, 200, 240)',
})
cloudBackground.s({
"back.opacity": 0.7,
})
clouds.s({
"shape3d.opacity": 0.7})},else if ((hour < 6 || hour > 19) || (hour == 19 && minutes >= 30)) {
/ /... omit
} else if (hour == 6 && minutes < 15 ) {
/ /... omit
} else if (hour == 6 && minutes >= 15 && minutes < 30) {
/ /... omit
} else if (hour == 19 && minutes < 15) {
/ /... omit
} else if (hour == 19 && minutes >= 15 && minutes < 30) {
/ /... omit
}Copy the code
conclusion
2019 we also updated the hundreds of industrial Internet 2 d / 3 d visualization case set, here you can find many novel instance, can also find different industrial Internet: mp.weixin.qq.com/s/ZbhB6LO2k… At the same time, you can also see more cases and results: www.hightopo.com/demos/index…