I'm looking for some help as to how I can accomplish the following task with Cesium... I have a 3D model that I would like to have a polyline emanate from. I'll know the line's heading and pitch in relation to the 3D model's orientation and I also know the length of the line.
So far, my approach has been to calculate the 3D model's direction by calculating a Cartesian3 velocity vector based on the 3D model's last two positions. I then convert the vector to spherical coordinates and add it to the spherical coordinates that are produced based on the desired heading, pitch, and magnitude of the line. So at this point I should have the theta and phi components for the line in reference to the earth because I have taken the 3D model's orientation into account. I also know the magnitude because that was given with the line's desired length. I convert the result into Cartesian coordinates and then draw the line from the 3D model's position to the result of adding the 3D model and the line's Cartesian coordinates.
What I have so far works if the heading and pitch are both 0 (i.e. I want to draw a line from the front of the 3D Model) but that's about it.
I'm assuming that there is an easier way to do this within Cesium's framework by using quaternions but this is my first exposure to them so I'm a little lost as to how to use them.
Does anyone have any advice or an example?