Tag Info

Hot answers tagged

33

This is a dimetric projection (a special case of the axonometric projection) with the horizontal axes at tan-1(0.5) ≈ 26.565° (an isomeric projection would have them at 30°, by the way) from the horizontal line. It's commonly called "isometric projection", but it isn't exactly one. EDIT: A simple transformation matrix for this one, assuming the x and y ...


22

Yes, To name a few: Pannini Mercator Fisheye Miller The Pannini projection, for example, can capture wide fields of view in nice ways. (totally just my opinion) I think implementation details would be beyond the scope of this specific question. EDIT: Thanks for the comment, I did misspell Pannini. And to make this edit worthwhile here are a few more: ...


16

EDIT Disclaimer: For convenience in this answer vectors with w==0 are called vectors and with w==1 are called points. Although as FxIII pointed out, that is not a mathematically correct terminology. However, since the point of the answer is not the terminology, but the need to distinguish both types of vectors, I'll stick to it. For practical reason this ...


16

In a perspective projection, not necessarily - in fact, the further the sphere is from center of projection, the more distorted it will be. Example: old picture of a distorted sphere.


15

If you can vary your speed (thus your angle of steer) you will always find a solution, starting from the degenerate one where the entity is almost stopped rotating in a little circle until pointing the target. If you can't vary your speed, you can think about unreachable areas or shadows that you can not reach even using your better steer, if the target is ...


14

Short Answer Yes, it can. You should simply calculate a View Matrix and Projection Matrix separately (which are both 4x4 matrices), multiply them together in that order and pass the result (which is still a 4x4 matrix) to your 3D engine. Long Answer Do you know the difference between a View Matrix, a Projection Matrix, and Perspective? You seem to be ...


14

It's isometric projection or perspective. Isometric perspective can work very well with a 2D game, and there is the example of the Flexible Isometric Free Engine which is a 2D engine, with an isometric view (though as it is flexible, that is not forced).


14

It depends on what you mean by "that could be used in a 3D system such as OpenGL". :) Narrowly speaking, 3D graphics hardware and APIs like OpenGL only deal correctly with linear projections - projections that map straight lines in world space to straight lines on the image. They never distort something into a curved shape (unless it was curved to begin ...


11

This is orthographic projection plain and simple. You can see this by the fact that all lines, especially the horizontal ones are perfectly parallel. Addendum: The comments are correct, this is isometric projection, which is a special case of the orthographic projection.


10

If we're talking about any projection, this is quite obviously not the case. After all, Cahill's Butterfly is a valid projection of a sphere onto a 2D surface: Non-uniform parallel projections will also tend to distort the shape. Perspective projections on the other hand won't distort the shape as long as the projection surface has zero curvature (that ...


8

Well, if you want to use it for 2D games (assuming from the tags), you only need a Transform matrix to apply to the SpriteBatch, you don't need World and Projection matrices. So, when you're drawing an object that should be drawn inside your game world (e.g. the main player), you use the following Begin method from SpriteBatch (XNA 4.0, replace the other ...


7

That is simple. You are using orthographic projection (viewing rays are parallel), so it doesn't make any difference if you are at distance 1 or 100. Use gluPerspective and it will work how you expect. (left img ortho projection, right img perspective proj) your code may look like this: glMatrixMode(GL_PROJECTION); gluPerspective( PI / 3.0f, ...


7

You guessed properly. The orthographic projection you came up with is the one used for most of the objects. You can tell because parallel lines in the X, Y or Z directions all become parallel lines, indicating that there is no perspective projection. Also, horizontal lines remain horizontal, meaning that X' does not depend on Y. Similarly, Y' does not depend ...


6

Pre- or post-multiplication just defines the order of operations how the member of that matrix and vector are multiplied, its purely a notational convention. The common operations in 3D graphics are post-multiplying a row-vector with column-major matrices (OpenGL) and pre-multiplying a column-vector with row-major matrices (DirectX). Both are basically ...


6

For a cavalier projection, it looks like you would want to start with an orthographic projection and then apply a shear to the z-axis. In other words, for OpenGL you would want to multiply the projection matrix on the left by a matrix of the form: 1 0 a 0 0 1 a 0 0 0 1 0 0 0 0 1 where a is the shear factor, which you'd tune to taste. (You could also use ...


6

Your description is a bit vague, but it sounds like what you're trying to do is map coordinates from one space (the window coordinates) to another (your tile coordinate space). Doing so is a simple transformation using the window size: x_trans = x - (windowWidth / 2); y_trans = y - (windowHeight / 2); x_norm = x / (windowWidth / 2); y_norm = y / ...


5

It's not saying the matrices are pre-multiplied but rather that they are (read use) pre-multiplication. This basically specifies the correct order of multiplication when using them, such that when multiplying a matrix by a vector, the matrix needs comes first. In other words, this: result = matrix * vector Instead of: result = vector * matrix


5

You can assign any arbitrary matrix to the pipeline's projection matrix in XNA, even one that doesn't perform a useful projection (you probably won't see useful results doing that, but you can). So you can construct an orthographic projection matrix yourself or use one of XNA's helper methods and use that. You'll also have to adjust the view matrix to ...


5

How is the rotated sprite generated? Are these screenshots of a rotating 3D model? The facing angle could be off due to the camera perspective of the 3D modeling tool. Isometric perspective is not an accurate representation of the 3D space. Stuff far away from the 'camera' does not get smaller. If you just want a quick fix. Solution 2 might be difficult ...


5

I solved my own problem--and rather than just blow it off as a simple explanation, I want to describe the steps I took to debug the issue. I left out that I was using a single FBO for special-effects. First, it turns out everything above is in fact correct and a step I left out was the problem. I verified my orthogonal matrices through-and-through. ...


5

The diamonds of the grid measure 23 by 45. If this were isometric projection, they would be in ratio 1:sqrt(3). (That is 35.264… degrees above horizontal, not 45 as Nathan Reed suggested.) By taking arcsin(23/45), we find that this projection is 30.737… degrees above horizontal.


4

Look at the reference of Matrix.CreateOrthographic, and notice that it says this: The viewable area of this orthographic projection is centered on 0,0,0. The x-axis of the area ranges from -width/2 to width/2. The y-axis of the area ranges from -height/2 to height/2. So, in your case, the upper border of the screen has an Y coordinate of -scale/2 instead ...


4

The multidimensional generalization of a triangle is an N-Simplex, here is a video of a projection of such an object. Here is another interesting video of a 4D hypercube. This wiki page is a good starting point if you want to learn more about the fourth dimension and how to visualize such objects. It also links a wiki page with a list of 4D games. ...


4

First of all, X points right, not left, in screen coordinates. But yes, the normalized device coordinates are a left-handed system. It doesn't matter for backface culling, though. From the OpenGL FAQ: OpenGL face culling calculates the signed area of the filled primitive in window coordinate space. The signed area is positive when the window ...


4

What you'll need to do is create a sheared projection matrix that leaves the X and Y axes alone but bends the Z axis up and to the left. The matrix to do the shearing would generally look like this: 1 0 A 0 0 1 B 0 0 0 1 0 0 0 0 1 Or possibly the transpose of that, depending on whether your math library is using a column vector convention (as above) or a ...


4

An example of what you might be looking for: http://blog.wolfire.com/2009/06/how-to-project-decals/ These forum topics should help you get started: http://forums.create.msdn.com/forums/t/16810.aspx (Graphics Runner's & Shawn Hargreaves's response) http://forums.create.msdn.com/forums/p/6574/131973.aspx (Nick Gravelyn's response) ...


4

I think your idea is pretty much spot on! First calculate a ray for your cursor using both the near plane and the far plane as Z values for your 2D coordinates (i.e. use 0 and 1 for your Z coordinate). Here's an helper method to handle that: public Ray GetScreenRay(Vector2 screenPosition, Viewport viewport, Matrix projectionMatrix, Matrix viewMatrix, Matrix ...


4

It all starts here: thick enough to stun an ox and to steal a meme: "If you don't like a wall of text, you're gonna have a bad time." Then since you're concerned with OpenGL, a side trip down Route 666 one of the classic OpenGL books But if you want to short circuit understanding of a complete graphics pipeline and just want to focus on some math for the ...


4

Almost all 3D games are fake 3D. At the end of the day, you're projecting a 2D image into the screen. The standard way to project a 3D scene onto a 2D scene is using a Projection Matrix. In every 3D game, the programmer has to think in 3D "world-space" and 2D "screen space" (and sometimes, 3D "camera space") but sir, I know the difference between SNES Zelda ...


4

After some more research I found out it's a Pinhole Camera Model. It is supposed to model a real camera. There is a nice description here: http://www.epixea.com/research/multi-view-coding-thesisse8.html What I was having trouble understanding was that I need some sort of projection plane. If there is no projection plane, all pixels would basically meet in ...



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