What are the best methods to fit SceneObject to screen?

Options
Daria Keller
Daria Keller Posts: 6
edited January 2023 in Programming #1

Hey everyone,

Question regarding fitting an object to the screen.

I have a rectangular cube (to keep it simple) with ratio equal to average screen ratio (9:16), the goal is to write a func which would fit it to the screen. The cube will use screen texture as the texture, so it should fit the screen 1:1. What are the best methods and what resources to check for proper implementation?

Key issues IMO:

  • ratio differs depending on the device used and also on whether front or back camera is used;
  • I suppose it should also use the estimated depth of an object relative to the camera (?).

Would appreciate any advice.

Answers

  • Tariq B
    Tariq B Posts: 96 🔥🔥
    Options

    You can check the preview and test this on different devices inside Lens Stduio