cybereality
Hi, really appreciate for your hint. I follow you guide and figure out the correct formula.
For anyone who go here by Google, assuming we set Keep Aspect is "Keep Height", then the correct ortho-camera size is:
ortho_camera_size = screen_width * pixel_size / 2
screen_width
is the width of the screen in pixel (can get with get_viewport().size.x
);
pixel_size
is the property of the Sprite3D node (default is 0.01), be aware to set the same value for all Sprite3D nodes
2
is here because the size of camera is the numbers of units we can see through half of the view port width (or height, depending on which dimension you keep aspect)
Example: if the screen_width
is 1920 pixels, the pixel_size
of the Sprite3D is 0.01, then the ortho_camera_size
is 1920 * 0.01 / 2 = 9.6