CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.8k stars 3.46k forks source link

VelocityOrientationProperty with roll #12200

Open jfayot opened 2 weeks ago

jfayot commented 2 weeks ago

Feature

Would you consider a PR introducing a new property that would be an extension of the VelocityOrientationProperty with a simulated roll?

Let's call it VelocityRolledOrientationProperty (any other name suggestion welcomed). Like it's little sister, it would take a position property as first parameter, but also a callback function rollModelCallback(speed, acceleration) defaulting to this minimalist formula

I know that this is a very approximate roll evaluation (no true air speed, x-y plane manoeuvre...) but it would allow to setup quickly airplane attitudes just with the positions.

Tell me your thoughts!

ggetz commented 2 weeks ago

Thanks for the suggestion @jfayot! Could you tell us a bit of background about your use case? To consider adding this to the API we would want to confirm:

  1. There's not an existing way to do what you need to do with the CesiumJS API, and
  2. It would be broadly useful for other users
jfayot commented 2 weeks ago

My use case is the following: I have series of GPS points with timestamps (could come from GPX or other datasources) for several airplanes (no heading/pitch/roll at all). What I want to achieve is the same as in this sandcastle, but using a dedicated orientation property that simulates the entity's roll. Of course, this could be done using the Cesium's API you would say ? Yes, but just as VelocityOrientationProperty would be possible with VelocityVectorProperty...

jfayot commented 2 weeks ago

@ggetz ok may be this is not the good way to go indeed! Having smooth rolls requires C2 interpolation continuity, which is not available yet with Cesium (CatmullRom splines are only C1)... At least, would you consider adding an AccelerationVectorProperty to ease end users computations?