How do you get the up of a point

60 views
Skip to first unread message

crocs...@gmail.com

unread,
Jul 24, 2019, 9:48:27 PM7/24/19
to cesium-dev
I am playing with rotations around the globe.

I would like to know if there is a way to get the UP of a point on the map.

By that I mean, if I go to a lat/long, the up would be the direction of the sky.

Thank you
Message has been deleted

crocs...@gmail.com

unread,
Jul 25, 2019, 6:24:12 AM7/25/19
to cesium-dev
The problem is I have a model, and a camera, the camera will be attached on the model like a TPS. The model got a rotation from a server, but the server just give the rotation of the model himself, without reference.

So I would like to get the normal vector of the tangeant of the map (ellipsoid ?) so I can use that up coordinate to calculate the rotation of the model 

Omar Shehata

unread,
Aug 13, 2019, 5:57:59 PM8/13/19
to cesium-dev
There's a couple of ways you can do this. This is what the Transforms.easyNorthUpToFixedFrame (https://cesiumjs.org/Cesium/Build/Documentation/Transforms.html?classFilter=Transforms#.eastNorthUpToFixedFrame) is for. This will create a transformation matrix for any given location on the Earth such that positive Z is in the direction of up, away from the ground. 

The other way is to convert your cartesian3 point to a cartographic point. Increasing the height will always be in the direction you expect. This is how this Sandcastle offsets any tileset up/down regardless of where it is on the globe:


Let me know if this helps!

crocs...@gmail.com

unread,
Sep 19, 2019, 11:13:08 PM9/19/19
to cesium-dev
Thank you Omar, this was very helpful 
Reply all
Reply to author
Forward
0 new messages