# Tag Info

## Hot answers tagged projections

18

Assuming a perspective projection and a view point external to the sphere, then the 'boundary' formed by the view point and the circle on the sphere which forms the horizon WRT the view point, will be a cone. Doing a perspective projection (onto a plane) is then equivalent to intersecting this cone with the plane which thus produces a conic section. FYI ...

15

I'd consider just going with 3D noise and evaluating it on the surface of the sphere. For gradient noise which is naturally in the domain of the surface of the sphere, you need a regular pattern of sample points on the surface that have natural connectivity information, with roughly equal area in each cell, so you can interpolate or sum adjacent values. I ...

14

This is more like a long comment to @SimonF's answer that I'm trying to make somewhat self contained. All cuts of cone are possible, hyperbola, parabola and ovals. This is easy to test by drawing images in a 3D engine by a extremely wide angle camera. Rotate the camera to say in 30 degree angle so the object is not in the middle of your focus. Then ...

13

Projection systems are used to convert a 3D shape to a planar (2D) shape. According to the type of projection system, different results and shapes like rectangles, pies, ellipses, circles, ... can be produced out of a sphere. Projection systems can be classified by the characteristics of the result they generate. To continue, I would like to use a very ...

12

If you are doing a perspective image and your model has implicit intersections then, if you use "linear Z", those intersections will appear in the wrong places. For example, consider a simple ground plane with a line of telephone poles, receding into the distance, which pierce the ground (and continue below). The implicit intersections will be determined ...

11

SimonF's reasoning basically convinced me, but I decided to do a sanity check. I loaded up a UE4 level that happens to have some spheres, like this one: I set the camera FOV up to 160 degrees to give lots of perspective distortion, and positioned it so the sphere was near the corner of the image: Then I took this into Inkscape and used the ellipse tool to ...

10

Because $x_{proj}$ doesn't vary from $0 \to width$, it varies from $-\tfrac{width}{2} \to \tfrac{width}{2}$. What's important is not the width, but the minimum and maximum values of $x_{proj}$. Because $(0, 0)$ is in the centre of the viewport, not the corner, the min and max values are plus and minus half of the width. BTW, the Red Book is not a great ...

8

Orthographic projections are parallel projections. Each line that is originally parallel will be parallel after this transformation. The orthographic projection can be represented by a affine transformation. In contrast a perspective projection is not a parallel projection and originally parallel lines will no longer be parallel after this operation. Thus ...

7

The near and far planes of a viewing frustum aren't needed for simple 3D→2D projection. What the near and far planes actually do, in a typical rasterizer setup, is define the range of values for the depth buffer. Depths in the [near, far] range will be mapped into [0, 1] to be stored in the depth buffer. However, the depths aren't simply linearly rescaled. ...

6

It's not 100% clear what the author means here, but I'll choose to interpret "screen coordinates" as "pixel coordinates". These would be related to the projected points by a 2D coordinate transformation. You're correct that projection is done by dividing each component of a point by its $z$ component. (That's not quite true—actually, we usually use ...

6

Using Z/W for the depth buffer goes deeper than just clipping against the near and far planes. As Simon alluded to, this has to do with interpolation between the vertices of a triangle, during rasterization. Z/W is the unique option that allows NDC depth values to be correctly calculated for points in the interior of the triangle, by simply linearly ...

5

Assuming your optimal viewing angle is parallel to the surface of the display and the pyramid is made from faces that are 45 degrees to its virtual (non-existant) base, it's actually just a simple non-transformed image (besides the reflection). 1:1 projection. No transformations. No scaling.

5

The ratio is with a quick and dirty visual measurement $665:501$ which is approximately $5:4$. You can measure it by taking the ratio of the vanishing angles $\alpha/\beta$ (see picture 1) because we are so close to the center. Image 1: Ratio of the inbound angles We can check the situation visually by drawing a 2 point perspective grid. For this we need ...

5

Let me try to make my comment into a complete answer. The general idea is to build a linear system using those 6 point pairs and solve for the desired 12 unknowns. You may find this paper[1] useful if you want to learn the theoretical background, and you can find some more details in my blog post[2]. Here is my solution using Mathematica. In the first ...

5

Yes, you can use an off-axis projection matrix. This is what I use in my code (note: I shift the centre upwards, not left as you do in your example.) void camera_setAspectRatio(float aspect, float zNear, float zFar, bool offaxis) { // create a projection matrix const float f = 1.0f / tanf(fovy_radians/2.0f); fovx_radians = 2.0f * ...

5

It might help to think of it this way: Both the near plane and the far plane are the size that will fit onto the screen you are viewing on. The further away something is, the bigger it can be and still fit on the screen. Close up, a playing card can fill the whole screen, but in the distance, an entire building can fit on the screen. Consider the example ...

4

Perspective projection changes the size of an object as it's distance changes, while orthographic projection does not. That is part of the definition of those projection types. To simplify things a bit, a simple perspective projection of a 3d point to a 2d point can be calculated like this: $x_{2d} = x/z\\ y_{2d} = y/z$ As you can see, the 2d version of ...

4

In this case, the geometry of similar triangles ABC and ADE is used to determine the height of D via the solution of DE. It is obvious that if the near plane is at 0 (AE=0), then a division by 0 occurs -- hence, why the near plane cannot be located at position 0. This is not why the nearZ plane cannot be zero. The goal of perspective math is not to project ...

4

After a quick google of 'Inverted perspective' I found out that you have five different names for it; Reverse perspective, inverse perspective, inverted perspective, divergent perspective and Byzantine perspective. https://en.wikipedia.org/wiki/Reverse_perspective I think that if you want to use it in a render engine using a projection matrix, in the ...

3

I don't think you can simply use TransformVector when the matrix you're transforming by involves a projection matrix. To fully project to screen space, you have to divide by W, which TransformVector doesn't do (it simply multiplies by the matrix without translation). Also, because of the divide by W, transforming vectors (as opposed to points) by a ...

3

I would not recommend to correlate the extrusion direction with its screen projection because of the asymptotic behaviour in case the axis points toward the screen or the resulting extrusion crosses the focal point of the camera. One consistent way of doing it would be computing the extrusion height independently of the axis direction: Find a virtual ...

3

The curve you are seeking is just the intersection of a plane (the back of the camera) and a right circular cone. This is not really a question about the earth, or views of planets from space; it's just plain simple 3D coordinate geometry. To find a reference, I'd recommend searching for "intersection of a plane and a cone" or "plane section of a cone", or "...

3

For the lightning, I recommend using a midpoint displacement algorithm. You start with a line segment between any 2 points A and B (this works in either 2D or 3D). Calculate the midpoint of the segment AB. Now move that point a random amount in the direction perpendicular to the line segment AB and call it point C. Replace the original segment AB with 2 line ...

3

It is bigger because it fills the same view and it ts further away. It would be smaller if it wouldn't fill the same view but then it wouldn't fill the camera view and it wouldnt work. So the inverse relation applies. If you want something to stay constant in size in the view then it needs to grow as it gets further. Your just comparing apples with ...

3

Copying this from another thread where i posted this as the answer but as Wyck suggested, the correct answer is the first one. There is the whole derivation of it but I'll be discussing a brief overview. This is for the perspective projection where the line joining the eye and the center of the projection/image plane is perpendicular to it. Like here As ...

3

To answer your question we just need to write it as linear algebra equations and solve them. Although your question doesn't state it, I assume that $v$ and $d$ are unit vectors. Let's call the projected point $x$. First, because the projected point is in the direction $d$, we can write: $$\vec{vx} = \lVert\vec{vx}\rVert d$$ Second, because $p$ and $x$ are ...

2

You need to use a cylindrical projection. So the key issue is how to prepare data for a cylindrical projection. Basically what you do is: You project your data on a sphere, it may be that this process was already done for you. And then you project it back to a cylinder Both steps can be easily taken care of by your cartography software. Will the data ...

2

In the video you linked to, $d$ is just the distance from the eye to the image plane. To simplify things though, you can just set $d$ to 1, which is the usual case and causes it to disappear from the formulas. Your formula for projection is a bit wrong but don't worry, projection is actually pretty simple. $x_{Screen} = x_{World} / z_{World}\\ y_{Screen} =... 2 The function calculates the intersection points between two edges of a triangle and a plane that is assumed to cut it. It returns a line segment running along the cut. Or more generally, the function calculates where the intersection points with the two edges would be, if the edges were extended to infinite lines. Given that it's called "project", that ... 2 Please read the references that are given to you: $$S = \dfrac{1}{\tan(\dfrac{fov}{2}*\dfrac{\pi}{180})}$$$\$ \left[\begin{array}{cccc} S && 0 && 0 && 0 \\ 0 && S && 0 && 0 \\ 0 && 0 && -\dfrac{f}{(f-n)} && -1\\ 0 && 0 && -\dfrac{f*n}{(f-n)} && 0\\ \end{array}\...

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