20 votes
Accepted

Does a sphere projected into 2D space always result in an ellipse?

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 ...
user avatar
  • 3,941
17 votes
Accepted

How can I generate procedural noise on a sphere?

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 ...
user avatar
15 votes

Does a sphere projected into 2D space always result in an ellipse?

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 ...
user avatar
  • 8,169
14 votes

Does a sphere projected into 2D space always result in an ellipse?

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 ...
user avatar
  • 283
13 votes

Why do GPUs divide clip space Z by W, for position?

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 ...
user avatar
  • 3,941
11 votes

Does a sphere projected into 2D space always result in an ellipse?

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 ...
user avatar
  • 23.6k
11 votes
Accepted

How am I able to perform perspective projection without a near plane?

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 ...
user avatar
  • 23.6k
11 votes

Why are width and height divided by 2 in the perspective projection matrix?

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}$. ...
user avatar
  • 6,450
9 votes
Accepted

What's the difference between orthographic and perspective projection?

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 ...
user avatar
  • 8,169
7 votes

How am I able to perform perspective projection without a near plane?

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 ...
user avatar
  • 8,101
7 votes

Why do GPUs divide clip space Z by W, for position?

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 ...
user avatar
  • 23.6k
6 votes
Accepted

Render with camera perspective off-center

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.) ...
user avatar
  • 260
6 votes
Accepted

Zoom in orthographic vs perspective projection

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 ...
user avatar
  • 7,341
5 votes

What transformations should I apply to a model to produce this 3D effect?

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-...
user avatar
  • 150
5 votes
Accepted

Calculate aspect ratio from 2D shape in 3D space

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 ...
user avatar
  • 8,169
5 votes

Solving a problem from *Foundations of Computer Graphics*:

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 ...
user avatar
5 votes

Projected points and screen coordinates

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 ...
user avatar
  • 23.6k
5 votes
Accepted

Why is the back of a perspective frustrum larger than the front?

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 ...
user avatar
  • 5,882
5 votes
Accepted

What is this graphical effect called?

I don’t think there’s a formally established name for it, but it’s generally known as distortion, warping, or refraction. It works by taking an already rendered version of the current frame, sampling ...
user avatar
4 votes

Need a reputable source for the formula for the shape of Earth's horizon

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 ...
user avatar
  • 330
4 votes

How to get the transform amount from a screen vector and a direction vector?

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 ...
user avatar
4 votes
Accepted

3D projection that increases objects' size as they become more distant

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 ...
user avatar
  • 1,565
4 votes
Accepted

How to derive a perspective projection matrix from its components?

The second matrix translates the eye [...] You don't do that in a projection matrix. You do that with your view matrix: Model (/Object) Matrix transforms an object into World Space View Matrix ...
user avatar
  • 1,457
4 votes
Accepted

Need help with change of basis (world to camera frame)

Since the transformation that is asked for includes a translation (the camera is located at a position other than the origin), you will indeed have to use homogeneous coordinates to describe this ...
user avatar
4 votes
Accepted

How to unproject cursor with orthographic projection

I am still not 100% sure, if I understood your question, because of this sentence: Now however with orthographic projection the far and near plane are of the same size, so we can't calculate the ...
user avatar
  • 1,150
4 votes
Accepted

$(x, y, 1)$ is 2D homogenous coordinates or 3D homogenous coordinates?

If you have $(x,y,z) \in \mathbb{R}^3$ and you relate it to $(x/z, y/z) \in \mathbb{R}^2$ then you have interpreted $(x,y,z)$ as one possible representation of the 2D vector $(x/z, y/z)$ in ...
user avatar
  • 1,838
3 votes
Accepted

How to use GetViewProjMatrix().TransformVector(LineDirection) in UE4?

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 ...
user avatar
  • 23.6k
3 votes

Creating Sparks using Code

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 ...
user avatar
  • 3,331
3 votes

Why is the back of a perspective frustrum larger than the front?

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 ...
user avatar
  • 8,169
3 votes
Accepted

Computing perspective directly

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

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