How do you get the up of a point

56 visninger
Gå til det første ulæste opslag

crocs...@gmail.com

ulæst,
24. jul. 2019, 21.48.2724.07.2019
til 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
Indlægget blev slettet

crocs...@gmail.com

ulæst,
25. jul. 2019, 06.24.1225.07.2019
til 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

ulæst,
13. aug. 2019, 17.57.5913.08.2019
til 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

ulæst,
19. sep. 2019, 23.13.0819.09.2019
til cesium-dev
Thank you Omar, this was very helpful 
Svar alle
Svar til forfatter
Videresend
0 nye opslag