Issue with Gizmo scaling on ORTHOGRAPHIC_CAMERA mode

using gizmo on Camera.PERSPECTIVE_CAMERA is normal, the scaling ratio is fixed. when change Camera.ORTHOGRAPHIC_CAMERA mode, the scaling will change with mouse wheel ?
How can i fix it?
20210809155322
2330210809155339

First - it will be wonderful if you can reproduce that on the playground so we can see the problem and try to help.

Just a note, @Cedric (who usually answers these types of questions) is OOF at the moment and won’t be able to provide his insights here.

1 Like

link → https://playground.babylonjs.com/#EBPQH9#57
the gizmo.scaleRatio not change, but gizmo in viewport changed, how to make it fixed ?

here’s another playground which using Perspective mode
https://playground.babylonjs.com/#QHK8BP

This is a bit of a tricky one. I think the issue here is that the gizmo is usually scaled based on camera distance but in your orthographic camera example, you are not actually moving the camera in space, but instead just changing the viewport dimensions. I thought we could just scale it based on the viewport dimensions, but it doesn’t quite stay the same size: Orthographic zoom demo | Babylon.js Playground (babylonjs.com)

We may have to wait for Cedric to get back for an answer on this one

1 Like

Yes, @DarraghBurke is right. Size is computed base on camera distance. If only the view dimension size change, without moving the camera away, gizmo size will not stay the same.

@DarraghBurke To me, the gizmo scale seems ok in the PG. Did you check with some screen capture?

1 Like

Actually, on second look I think you’re right, this solution seems to work. It only appears to change size because it’s changing relative to the alien, but I think it’s an illusion.

@DWork does this work for you?

Thanks, is works, that’s the best way to do it now :smiley: