Qbasicnews.com
2d camera functions - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html)
+--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html)
+--- Thread: 2d camera functions (/thread-8644.html)



2d camera functions - SBM Productions - 12-25-2005

I want to set up a 2d camera such that it zooms in or out to accomodate for a player moving out of screen, not translating the screen. The screen needs to maintain a 4: 3 aspect ratio. Any ideas how I might go about calculating it?


2d camera functions - TheBlueKeyboard - 12-27-2005

Hmm....well I think the real problem would be the scaling of the sprites/tiles.
You could use OpenGL, Im not entirely sure how you would calculate the zooming in/out, but if I think about it for some time I could figure it out...


2d camera functions - SSC - 12-27-2005

Well I don't know much about OGL yet, but if you set up a 2D plane in 3D space with opengl then all you should have to do is adjust the z axis of the plane to zoom in and out, and to focus on a specific point just adjust the x and y along with the z.