0
\$\begingroup\$

I'm working on a shooting simulator with shooting goals that need to be in real world size. I know the certain size of screen display and pixel counts.

Is there anyway to change their size based on screen information?

let me explain more about question.

its a real shooter simulator with real guns. image of unity simulation is projected on a wall or... by a video projector. I want to scale goals as real ones. I know size of screen and even size of every pixel. so I want to scale my rectangular goals with size of real ones.

I think the question now is obvious

\$\endgroup\$
  • \$\begingroup\$ The answer is also obvious, use them as the unit scale, scale everything else to match up. \$\endgroup\$ – Joshua Hedges Jun 6 '17 at 19:26
0
\$\begingroup\$

If you mean that they need to have static sizes regardless of screen size, you would need to calculate by resolution AND exact screen size (this is actually difficult, as you'd need a database of all possible screens this can run on).

So, for instance, 1cm x 1cm images are going to be different pixel sizes on an iPhone 4 and an iPhone 6 Plus, not to mention on a Galaxy S7.

iPhone4 = 960 x 640 resolution on a 7.4cm x 4.9cm screen = ~130px x 130px

iPhone 6 Plus = 1334 x 750 @ 12.2cm x 6.8cm = ~110px x 110px

Galaxy S7 = 2560 x 1440 @ 11cm x 7cm (roughly) = ~ 230px x 230px

Needless to say, this isn't an ideal scenario to try to pull off, which is why it's rare for games to use real-world sizes for things.

\$\endgroup\$
  • \$\begingroup\$ I think you didn't understand the question. I will modify that \$\endgroup\$ – virtouso Jun 6 '17 at 19:07
  • \$\begingroup\$ The answer is still similar, except now as to the size, it's a function of distance of the projector to the wall and the image size it can properly light. In this case, resolution is almost useless because the "real" size is solely however large you let your focal point get. \$\endgroup\$ – Jesse Williams Jun 6 '17 at 19:42
  • \$\begingroup\$ For example, you could use an Epson projector, set the size and go with it. A user could use the exact same projector, but have it 0.5m further away from the wall and the displayed image will be x amount larger. For a demo, this can be handled if the user has the ability to manipulate the projector placement. In many instances, the projector and screen are fixed distances from one another and there would be no specific control over resulting size. \$\endgroup\$ – Jesse Williams Jun 6 '17 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.