Tag Info

Hot answers tagged

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 ...


16

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.


13

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 ...


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

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

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 ...


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

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 ...


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.


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

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

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 ...


2

A matrix is one of many ways of storing an arbitrary transformation, but it happens to be a very simple way, since "apply the transformation to a point" is simply "multiply a vector by a matrix". Fundamentally, you have several coordinate systems you are converting between: 3D Object Space. This is the logical location of your objects. 3D Camera Space / ...


2

Suppose we want an object to appear that it has constant size, regardless of the camera's position, in a 3D perspective projection. The solution is to scale the object in every frame, to increase/reduce it's size. Suppose we want the object to be 1/4 of the size of the viewport. This can be calculated as follows : const double fov = Math.PI / 4.0; ...


2

Use storyboards and blocked out animations to preview game play changes, both are easy to create and cheap to modify until you arrive at a solution. Movie studios call this "prefiz" and use it to save money and effort. You can animate several new viewpoints in a day and save a week of coding.


2

The question is not how to implement vector graphics with modern 3D APIs like OpenGL and DirectX, since doing it is quite easy and does not require to build a vector/matrix system from scratch like those games did. Vectors are literally just a list of numbers. Matrices are just a grid of numbers. The interesting part is the mathematics you use on them, ...


2

You are looking for vertex based 3D supporting arbitrary (unrestricted) geometries in 3D space. Raytracing in the original sense is real 3D in that it may support unlimited degrees of freedom (DoF). Raycasting (in the game development sense rather than original sense which is similar to raytracing except for the direction of rays), however, restricts degrees ...



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