How to fix the 3D model position even the camera moves?


From the Sandcastle 3D Models example, I wanted to place the 3D model on its same position even I zoom-out or zoom-in.

Currently, when I zoom out, the model is coming along with the camera. If I completely zoom out from the globe, the model is coming out of the globe.

Can help me how to fix the model position relative to its own position even when we zoom-in or zoom=out.

Thank you,


Actually it is an illusion that the model is following the camera as the camera continues to move backward (at least in a Earth relative sense.)

Earth-relative it is in the same spot, but is becoming larger and larger. Move the view so that the Earth blocks the view of the plane.

Camera-relative it does stay the same size and camera-relative-location while the Earth appears to become smaller.

However this behavior only occurs if you exceed a certain distance from the model (in terms of Earth coordinates.)

This is optional behavior controlled by the minimumPixelSize property. Just remove this setting from the example and the model will always stay it’s true side and get smaller as you move away from it.

Thanks for the info on minimumPixelSize. I assume minimumPixelSize defaults to 0 if it’s not set? One use would be to prevent a plane from becoming too small to see, an alternative to placing a 3D label indicating where the plane is.

Technically it’s undefined, but treated as 0 under the hood. Setting it to 0 explicitly has the same affect.

You can also combine minimumPixelSize with label eyeOffset so that you can have label next to an icon sized version of the model when zoomed out, eliminating the need for a billboard (though models are more heavyweight).

Thank you for the solution. It fix my issue :slight_smile: