Hello,
How can I move an entity a specified distance/direction from its current position?
Hello,
How can I move an entity a specified distance/direction from its current position?
I don’t see a function in http://cesiumjs.org/Cesium/Build/Documentation/EllipsoidGeodesic.html with initial lon/lat/hea along a distance.
However there’s JavaScript code you can use over at http://www.movable-type.co.uk/scripts/latlong.html
Just scroll down to “Destination point given distance and bearing from start point” to find it.
2015年4月5日日曜日 2時29分54秒 UTC+9 D2P:
Hello,
How can I move an entity a specified distance/direction from its current position?
HI.
var position = Cesium.Cartesian3.fromDegrees(lng,lat, alt);
var heading = Cesium.Math.toRadians(convertHeading(heading));
var roll = Cesium.Math.toRadians(roll);
var pitch = Cesium.Math.toRadians(pitch);
var ac = Aircrafts[name]; // <= Entity store this array
if ( ac == undefined ) return;
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, heading, pitch, roll);
ac.position = position;
ac.orientation = orientation;