-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use better example in Transforms doc #7041
Conversation
Thanks for the pull request @OmarShehata!
Reviewers, don't forget to make sure that:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@OmarShehata ICRF (Inertical Coordinate Reference Frame) is a standard reference frame used in many space based applications. It basically means "Make the camera behave as if it were stationary and the earth (or any origin point) were rotating under it instead of being locked into an earth based position" The analog to Inertial is the Fixed frame, which means the camera is locked into an earth based position (or any origin point) as the earth moves, the camera moves with it. I think the reason there is no comment is because "view in ICRF" is self explanatory to anyone interested in an inertial view. If you want, you can always add a link to some explanation of ICRF though I'm not sure Wikipedia is the best link to go to. As for why tilt doesn't work in the example, that sounds like a bug in the example, not the intended behavior. |
Thanks for the context and explanation @mramato ! Definitely wasn't aware of that. In that case, I think the code example doesn't do what it's intended to. Here's a Sandcastle where you can see the camera is still locked into an earth based view. Here's my example which does make the camera behave as if it is stationary. Although neither allows the camera to tilt as far as I can tell. |
Your example matches what's in the Camera Sandcastle and it definitely the correct one to use. Both have the tilt issue because they are calling lookAtTransform with the result of |
Couldn't get the complete transform applied correctly, but this should at least be a more correct example than before. I updated the comments in the example to just say "View in ICRF". I think it's still worth adding a comment since the doc on that function say it transforms a point or a vector, and so this example is showing you how to use that to set the view, (as opposed to just transforming a point). |
@mramato do you think this looks good to merge? |
The current example for Transforms.computeIcrfToFixedMatrix is the only one on the page that doesn't have a comment describing what it does.
It seems like it prevents the camera from tilting. I think we should at least describe that if that's the intended use case. Although since you can just disable tilting with a flag on the camera, I propose we use this simpler example instead:
I don't think there's another way to do that so it's nice to have that example in the doc.
I also wanted to use
viewer.scene
instead ofscene
so that it works if you copy paste it without having to definescene
andcamera
but it would make it feel inconsistent unless we change all examples to do that.