3Dtileset: Rotation around custom pivot via CesiumJS

Hey, I’m facing an issue with rotating a model (3Dtiled) on custom point- it’s rotating from unintended axes too. - Here is the sandcastle: Cesium Sandcastle

I got some support where we were able to rotate around a custom pivot - Cesium Sandcastle, but values were constant which makes it difficult to use it for different position and different models.

Looking for some generic solution where we can rotate a model around custom point!!
TIA.

We talked about a few points via private messages here. The second sandcastle already does offer the option to click at a certain position, and afterwards rotate around that clicked point. But when the user is rotating around that point, then clicking another point and then trying to rotate around that one, the behavior is … certainly not the intended one :slight_smile:

One has to be clear about the requirements and expectations. (For example: If the goal is mainly to move and rotate a tileset, then rotating about an arbitrary, user-selected point might not be the most intuitive way to achieve that).

And one has to go into some details about the intended behavior, and always keep corner cases in mind. (For example: What happens when the user clicks a point at the opposite side of the earth, and then wants to “rotate” around that one?)

Hi Marco,
Yeah, that’s correct - now I have moved to forum so we can detail it and can help others.

I agree with you that 2nd sandcastle is working around this - but where its raising difficulty is: It is using constant values which make it difficult to use for different tileset, or same tileset at different location.

I can answer couple of question which will make the issue clearer.

What we want to achieve?

Rotate a model around custom pivot. We can select the new pivot own, for now to make it dynamic we have let the user to select the new pivot. At the end we want to make the new pivot a center point for rotation - we don’t want to translate a model (during a process if it’s leading minor translation that’s fine)

What is the issue you are facing?

When I’m directly using the same rotation matrix (without translating it to new pivot) it’s working well.
Now when I’m doing below:

  1. Translate the model to new pivot
  2. Rotate the mode and
  3. Place back the model to original pivot

We are facing the above behavior (rotating from unintended axes) not sure how to control that!

What is the issue with 2nd sandcastle (the already provided solution)?

It uses the constant value, which is making difficult to adapt the solution where we might have different tileset and at different location.

For now, i haven’t considered any corner cases: Though the click is restricted to model - user can’t make a center of rotation outside model

I hope this information will help :grinning: