![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Cro-Iba |
I’d like to render a sprite within a 3D world, but I’d also like that sprite to be rendered billboarded at a fixed size that is also the full size of the base image. Specifically, the image I have is 1080x1080, and I want it to appear on screen at a given resolution at precisely that same size. Essentially, I want it to act like a 2d sprite except that it can intersect and overlap with existing 3d meshes. I have a MeshInstance already made that essentially does this, except that without changing scale or mesh size, it appears significantly larger than the base image; I have to size the mesh from 1 to 0.355 to approximate the size I want at 1080p, but I don’t know how I could possibly discern this number without eyeballing, and it’s almost certainly not precisely accurate.
I figure this can’t be an uncommon want, like to hang GUI above entities but also let them be occluded by terrain. What’s the best way to do this?
I don;t know the specific functions, but if you use a world_to_screen co-ords function, you should be able to get screen size of a 3D object, and scale accordingly.
SteveSmith | 2023-02-10 18:00