modelMatrix
The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates. When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by Transforms.eastNorthUpToFixedFrame.
const center = Cartesian3.fromDegrees(-75.59777, 40.03883);
labels.modelMatrix = Transforms.eastNorthUpToFixedFrame(center);
labels.add({
position : new Cartesian3(0.0, 0.0, 0.0),
text : 'Center'
});
labels.add({
position : new Cartesian3(1000000.0, 0.0, 0.0),
text : 'East'
});
labels.add({
position : new Cartesian3(0.0, 1000000.0, 0.0),
text : 'North'
});
labels.add({
position : new Cartesian3(0.0, 0.0, 1000000.0),
text : 'Up'
});
Content copied to clipboard