# Tag Info

19

I believe your intuition was correct, just not your formula. atan(4 / 3) = 53.1301024 degrees This ratio can be useful because it forms a Pythagorean triangle, meaning that the length of the diagonal is an exact integer value.

17

Generally it is true, depending on your view point and in which direction it has moved, as well as the viewing angle. Note how in the first camera view, as the Red block is perpendicular to the camera view, the object seems to be twice as large in a perfect 1:2 ratio (Note the arrow pointing that it hits the edge of the view after being moved twice as ...

14

One of my favorite classic arcade games also happened to do fake 3D: Space Harrier In that video you can see a few tricks they used, but one of the most effective visual effects is so seamless that you might not even notice it happening: when the player (or importantly the camera) moves, they use parallax to give objects in the scene a feeling of depth. ...

8

If you're going to ask the user to aim up and down, you need the player to be able to judge those up and down distances. With a static top-down camera, that is virtually impossible, and grossly unfair of you to demand of the player, no matter how you map it to controls. If you're set on using a top-down camera, then your player character should handle ...

6

Actually that's pretty much true (if you move an object twice as far away it looks half as big) but it obscures how the visual size of objects should change as the viewers moves. Specifically, objects appear to get bigger faster the closer they are. That's because the viewer covers half the distance a lot faster when the object is close, compared to when the ...

6

An object twice as close does appear twice as big. It is a consequence of Thales's Theorem and it is true in the real world. One could argue that Thales's Theorem is the core mathematical tool behind perspective projection and what's known in the graphics pipeline (OpenGL or DirectX) as perspective division. It a theorem you should definitely know, and ...

6

I think having a FoV of 90deg is what feels natural when you try to mimick 'looking through human eyes'. Your calculations would be correct if you would use the screen to simulate a window into a virtual world, not a first person perspective. Image you would have to see the world trough a 20" frame 80cm away from your head ...

6

I've changed the shader according to the article suggested by Seth Battin. Now it performs perspectively correct quad texturing. Phew, bacon delivered: For the future generations that may never happen. The input is in a form of the line vertexes A1/A2, B1/B2 that creates diagonals (rather then sequential vertexes): public static Vector3 ...

6

You can't. The two matrices are constructed in completely different ways. There are tons of ways to find more information on that by googling. You can't get the field of view from the orthographic camera because there is no such thing.

5

You can't multiply the angle by the aspect ratio directly; the aspect ratio is the ratio of pixels horizontally vs. vertically, not the ratio of the angles. To demonstrate the problem: Assume we have a window that's 100 pixels tall, and 1000 pixels wide. That's a 10:1 aspect ratio. If we have a 90 degree vertical field of view, then naively ...

5

I think you can tell the difference from whether you have 1 or -1 in the Z line (or column depending on the matrix orientation). In particular: Left handed: 1 Right handed: -1 For a comparison, see both of these links - D3DXMatrixPerspectiveLH and D3DXMatrixPerspectiveRH. Since DirectX is left handed, you'd normally use the left handed version which has ...

5

You haven't done the division by w. Also, the [-1, 1] range after projection needs to be linearly remapped to [0, 1], not clipped. Try this: vec4 vPosition= MVP * vec4(vVertex, 1); vec3 vPositionDivided = vPosition.xyz / vPosition.w; float z = vPositionDivided.z * 0.5 + 0.5; vSmoothColor = vec4(z, z, z, 1); gl_Position = vPosition; Finally, Z is not ...

5

I found a fantastic review of these techniques, with examples and explanations, several years back. Your question prompted me to search for it again: Lou's Pseudo 3d Page. He used to have a working Outrun engine but removed it for some reason (the Wayback Machine if your friend here) To further answer your question, here is a list of the games from his ...

5

Most of these games use the famous "Mode 7" tricks. It is just a rotozoom. This operation was done by coprocessor on console so it was very fast on these hardwares. Real 3d operations were too costly. But with actual hardware, it is easier to simulate with real 3D. A rotozoom is a rotation and a zoom on a sprite. Look this explanation or this SDL ...

4

All 3d games are fake 3d :P I'm joking, I know what you mean by 'fake 3d'.. Well, the 8/16bit has several examples of a very common technique of presenting the background in layers moving with different velocities, to mimic parallax. It was also very common to see.. actually, it's easier to just look at any racing game made for those consoles than ...

4

Remember one thing: Perspective projection ==== division by distance from camera. Let's say, that camera is at 0, so distance is Z coordinate of your object. So your ball has X and Y coordinates equal to zero, it only changes the Z coordinate and you want to compute the size depending on Z. Let's say, your object is sliding between Z=100 and Z=10. First, ...

4

I'm assuming you know how basic matrix math works, so I'm not going to cover that in my answer. What you eventually want to do is transform the vertices of the object you want to render from the virtual 3D world to the "real" 2D world (your monitor screen). You do that by multiplying the vertices of the object with a camera matrix (some people may use other ...

4

This is an old question, so I'm guessing that tom37 may have moved on by now, but I think I have an answer for anyone else with the same problem. For reference, here is a view of a surface grid using a perspective camera. Now let's say that we want to render a portion of this current view, but to the entire screen. Let's render the top-left quarter of ...

4

If you are looking to use any 3D objects (lets say a chessboard with 3d pieces), you could make a series of quads, then manipulate the camera's position and target to get the angle/perspective that you want.

4

In fact, the original question is 1 cast away from the solution. Original Code glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(60, window.width/window.height, 0.01f, 100.0f) Fixed Code glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(60, (float)window.width/window.height, 0.01f, 100.0f) The problem was that window.width and ...

4

Luckily for you, you don't actually have to deal with any of this! Instead of actually creating a top-down world, you can use Unity's built-in 2D mode, and create sprites instead of cubes and planes, to make it look like it is top down. 2D mode makes the camera line up automatically, and have the depth appear to be non-relevant, though it is. Also, there are ...

3

Jazz Jackrabbit and the old Sonic games had those Bonus Worlds that were pseudo 3d.

3

Unless I'm misunderstanding you, this sounds like the presentation that Dwarf Fortress gives, at least from a top down perspective. Or, if you're looking for isometric, people have created visualizers for Dwarf Fortress that give that effect. For example: As you can see the image shows multiple layers. The user is then able to "slice" down into the land. ...

3

You do not mention a view matrix which is usually used for camera position & rotation while the projection matrix is used for zoom(FOV) & frustum params. Although these two get combined in the end into a final "camera" matrix to render the object, I've not seen an engine where you have to maneuver the combined result... You always maneuver the view ...

3

You are talking about doing manually something which is already done for you automatically by 3D APIs. One of the most basic functions of any 3D engine is to handle the transition from a bunch of objects in 3D space and a camera (naturally you must always have a camera) to a 2D picture (technically a projection) on the screen. In your case, doubtless an ...

3

A lot of the effect of FOV is on how fast you seem to move through the world (it's still the same speed; this is purely perceptional). With too wide a horizontal FOV you'll seem to move very fast, with too narrow you'll seem to move very slow. 90 degrees horizontal appears to be the "sweet spot", and the game developer can tune a desired movement speed for ...

3

Simply because there are many ways to compute the projection of objects in a 3D scene onto a 2D plane. That's why you have perspective versus orthographic projections (and various flavors thereof, such as off-center projections), and that's why you can use slightly different formulae to compute the projection transformation. Sometimes the differences are ...

3

These are the two main solutions I can think of: If you use tilesets, add a rectangle on top of your tiles. You should also move the collision detection up a bit, not to have your character walking on the edge of the blocks. However, this can easily look like the character's feet are passing through the ground but it mostly depends on the quality of the ...

3

I don't know what vertex data you're using to draw that, but supposing it is a cube, I wouldn't say that the perspective is VERY wrong, or even wrong at all, on the left picture. Based on your commented-out code, your ultimate view-projection matrix is getting calculated like this: identity * translation * projection * rotation Your drawing is getting ...

3

You can do this in two ways, both of which require 3D cameras and projection: First, give all of your objects a 3D position in the world. // XYZ Vector3 Position; Next, create a camera with a position and orientation: class Camera { // Position of the camera in the world Vector3 Position; // Place where the camera is looking Vector3 ...

Only top voted, non community-wiki answers of a minimum length are eligible