I know how an antenna located on Earth surface is pointing to an object in space, by means of Altitude and Azimuth.
I would like to show the pointed object in the 3d view, so, as far as I can understand, I need its position in (x,y,z) format (Cartesian3 object?)
But I can't understand exactly which is the exact process to follow.
I am using this example using CesiumJS library to make experiments; I added one point on surface by adding these lines inside function addMultiplePoints() :
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(290.6, -35.78),
point: {
color: Cesium.Color.RED,
pixelSize: 18,
},
label: {
text: "MLG",
font: "14px Helvetica",
pixelOffset: new Cesium.Cartesian2(0.0, 20),
},
description : "MLG"
});
Now I have to add a point with specific location w.r.t this point, say Alt=30, Az=0.
I am trying with this... but nothing happens; indeed, in this code there is no origin point for the coordinates...
H2pointing = {"alt" : 30, "az" : 0};
clock = 90 - H2pointing.az;
cone = 90 - H2pointing.alt;
H2spherical = new Cesium.Spherical(clock, cone, 10);
console.log(clock);
console.log(cone);
console.log(H2spherical);
H2cartesian = Cesium.Cartesian3.fromSpherical(H2spherical, null);
viewer.entities.add({
position: H2cartesian,
point: {
color: Cesium.Color.BLUE,
pixelSize: 18,
},
label: {
text: "Hayabusa2",
font: "14px Helvetica",
pixelOffset: new Cesium.Cartesian2(0.0, 20),
},
description : "Hayabusa2"
});
So, assuming my calculations are right (are they?), how do I center this point on previous point?
Maybe I could use another method:
Cesium.Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)
If I specify Roll = 0, I should get the equivalent of Altitude and Azimuth.
But, also in this case, how to apply this transform to a point?
headingPitchRollToFixedFrame Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.