Forum Discussion
webstorms
12 years agoHonored Guest
Zoom out
Currently when I display a texture/image to the screen, it seems so close to me. Is there a trick to zoom out and make the image appear further away? Or does the image appear so near because of the im...
iamdak
12 years agoHonored Guest
Parts of your code doesn't makes sense, but its close. Assuming you aren't applying any transformation matrices, your geometry will render points within the bounds of -1 <= x <= +1 and -1 <= y <= +1. If you were to render the points:
(1,1) (-1,1) (-1,-1) (1,-1)
Then you would get a quad that fills the screen perfectly but it may be too wide if you're using a standard aspect ratio. To correct for this, we'll keep the vertical axis alone and squeeze the horizontal axis by the aspect ratio. We can say the following:
AR = ScreenHeight / ScreenWidth
Then set that as our x value:
(AR, 1) (-AR, 1) (-AR, -1) (AR, -1)
This will take our full screen quad and squeeze it into a perfectly square quad. Next, for the magnification you just want to multiply by some scalar:
zoom = 1.0
(AR * zoom, zoom) (-AR * zoom, zoom) (-AR * zoom, -zoom) (AR * zoom, -zoom)
And you're done! If you wanted to render twice for the rift, you can add a translation value to the coordinates and render twice. Working with matrices will beak down the exactly the same math but your way works well for simple applications.
Good luck.
(1,1) (-1,1) (-1,-1) (1,-1)
Then you would get a quad that fills the screen perfectly but it may be too wide if you're using a standard aspect ratio. To correct for this, we'll keep the vertical axis alone and squeeze the horizontal axis by the aspect ratio. We can say the following:
AR = ScreenHeight / ScreenWidth
Then set that as our x value:
(AR, 1) (-AR, 1) (-AR, -1) (AR, -1)
This will take our full screen quad and squeeze it into a perfectly square quad. Next, for the magnification you just want to multiply by some scalar:
zoom = 1.0
(AR * zoom, zoom) (-AR * zoom, zoom) (-AR * zoom, -zoom) (AR * zoom, -zoom)
And you're done! If you wanted to render twice for the rift, you can add a translation value to the coordinates and render twice. Working with matrices will beak down the exactly the same math but your way works well for simple applications.
Good luck.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 1 year ago
- 11 years ago
- 12 years ago