Best field of view (FOV) for 2D polygon games

Started by
7 comments, last by Steadtler 16 years, 8 months ago
Usually for 3D games the best FOV is 45º (PI/4), but this produces some distorsion on sides of the screen, for 3D is usual because the eye produces some distorsion on sides, so no problem. But for 2D polygon games surely we don't want that distorsion, then I'd like to know the opinion of experienced users/programmers of those type of games. I am trying 2 FOVs, 30º (PI/6) and 20º (PI/8), 30º is a good aproximation because it produces too few distorsion and we have a good zoom/distance proportion, 20º gives us less zoom/distance proportion but eliminates totally the image distorion (it is really impossible to perceive). So, what do you think is better?, remove the distorsion totally or having some better FOV with some little distorsion?.
Advertisement
Would an orthographic projection be out of the question?

All the best,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
Surely yes, because although is a 2D playing game, as we use polygon we want to have some perspective, if not up, down and sides of the objects are not seen.
Here're some examples of a commercial game:

http://a248.e.akamai.net/f/248/5462/2h/images.gamezone.com/screens/21/4/77/s21477_ps2_11.jpg
http://www.gamereality.org/Kuvat/gradiusv/1.jpg
http://www.gamereality.org/Kuvat/gradiusv/2.jpg
http://www.gamereality.org/Kuvat/gradiusv/3.jpg
http://www.gamereality.org/Kuvat/gradiusv/6.jpg

What do you think?, viewing the circles and spheres on screen sides and corners, and the screenshot http://www.gamereality.org/Kuvat/gradiusv/3.jpg that shows some depth perspective on the background, I am not sure if are 30º or 20º.
There is nothing in that screenshots that cannot be done with an orthographic projection.
The depth perspective in

can be a simple background image. A video can show better if it’s a simple image or something different.
In orthographic projection you can always scale the object based on distance to give the impression of a perspective projection, but in that screenshots every object appear of the same size.
It is not a background image

http://www.gamespot.com/ps2/action/gradius5/media.html?om_act=convert&om_clk=tabs&tag=tabs;videos

see some 'gameplay movie'. We can see too that the foreground has some perspective.
This will make an OpenGL unit on the plane Z = -256 equal one pixel. It also makes it so vertex(-screenWidth, -screenHeight, -256) is the bottom left of your window, and vertex(screenwidth, screenHeight, -256) is the upper right of your window.

glViewport(0, 0, screenWidth, screenHeight);glMatrixMode(GL_PROJECTION);glLoadIdentity();glFrustum(-screenWidth / 64.0f, screenWidth / 64.0f, -screenHeight / 64.0f, screenHeight / 64.0f, 8, 65536);glMatrixMode(GL_MODELVIEW);


So, if you wanted to draw a 100x100 pixel quad:
glTranslatef(0.0f, 0.0f, -256.0f);glBegin(GL_QUADS);   glVertex(-50.0f, -50.0f, 0.0f);   glVertex(50.0f, -50.0f, 0.0f);   glVertex(50.0f, 50.0f, 0.0f);   glVertex(-50.0f, 50.0f, 0.0f);glEnd();


Using Gradius as an example, the ship would be drawn at vertex(shipX, shipY, -256), the hud would be drawn in ortho mode, and the 3d background would be drawn at Z = -500 or so.
Interesting, with that you can use all the classic 2D methods, because you can work with virtual pixels.

In the other hand I draw the HUD with manually 2D transformed vertices, (D3DFVF_XYZRHW in D3D) so I can directly draw in screen coordinates, and with DrawIndexedPrimitiveUP(), that is faster than SetStreamSource()+DrawIndexedPrimitive() for few polygons, I have tried both and PIX (MS DX profiling utility) said the first is faster.

So I can easily manage 2D vertices with CPU (no need to Lock() operations), I recommend you to use this for game panels, easy and fast.
Quote:Original post by apatriarca
In orthographic projection you can always scale the object based on distance to give the impression of a perspective projection[...]


Thats often called weak perspective projection.
You should also check out paraperspective projection.

This topic is closed to new replies.

Advertisement