Skip to main content

Questions tagged [perspective]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
28 votes
5 answers
13k views

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

My intuition has always been that when any sphere is projected into 2D space that the result will always mathematically be an ellipse (or a circle in degenerate cases). In the past when I was ...
hippietrail's user avatar
25 votes
1 answer
959 views

Is my perspective math correct?

I've got a homework in which I have to calculate and plot some points using a pespective transformation, but I'm not sure my results are correct, since the 3d plot using Camera coordinates looks very ...
Vitor's user avatar
  • 353
13 votes
1 answer
27k views

What's the difference between orthographic and perspective projection?

I have been studying computer graphics, from the book Fundamentals of Computer Graphic (but the third edition), and I lastly read about projections. Though, I didn't exactly understand what's the ...
phong's user avatar
  • 265
9 votes
2 answers
3k views

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

I'm learning about 3D computer graphics, but I'm having a hard time understanding why the near plane of a viewing frustum can not be placed at z position $0$ (right at the camera). I can understand ...
William Breathitt Gray's user avatar
9 votes
1 answer
1k views

Calculate aspect ratio from 2D shape in 3D space

Given the 4 coordinates of a 2D shape in a 3D space I want to calculate its aspect ratio. The 3D space is created with 2 vanishing points. The 4 coordinates - marked blue - are the 2D coordinates on ...
succcubbus's user avatar
8 votes
1 answer
6k views

Perspective Correct Texture Mapping

So I'm trying to correctly map my textures in my software renderer using the u, v coordinates but I can't seem to get it working. I got affine texture mapping working. This is what I can produce using ...
Andrew Wilson's user avatar
7 votes
1 answer
220 views

What is this triangle sub-division scheme called?

I have thought of a triangle sub-division for the purpose of smooth triangulation (no popping) over time on the fly. I think it is very likely the scheme is already invented and has a name but I can´t ...
Andreas's user avatar
  • 359
7 votes
0 answers
737 views

Perspective-Correct Texture Mapping

I am working on a small rendering engine for a personal project and I am having issues with the texture mapping part of it. It seems to work for some cases, but not for others. For example, when one ...
neat's user avatar
  • 71
6 votes
1 answer
919 views

Perspective correct interpolation of normal values

I'm currently writing a software rasterizer and I'm at the point where I can draw arbitrary triangles with vertex colors and perspective correct texture mapping. I do point and directional lighting by ...
lelgetrekt's user avatar
5 votes
3 answers
750 views

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

I'm following this tutorial on the perspective projection. Question: If the point of a perspective projection is to create the perspective effect (where objects faraway appear to be smaller): then ...
George's user avatar
  • 253
5 votes
1 answer
2k views

Render with camera perspective off-center

So ordinarily we have this But I'm after this! Is it possible to do this? Ideally by changing the projection matrix? The reasoning is kinda interesting - I am developing for mobile VR, and I have ...
Hamish Todd's user avatar
5 votes
2 answers
271 views

Rendering Hypercentric Perspective

I came across some Non-Euclidean Games which involve Hyperbolic Spaces, Spherical Spaces, Portals, etc. And, I noticed that they give quite deep feel of what Non-Euclidean Spaces feel like. So, I was ...
Monster196883's user avatar
5 votes
1 answer
2k views

Why does this gl_FragDepth calculation work?

I am raytracing in GLSL. My gl_FragDepth calculation wasn't right, so I did some hunting and found this solution (P is the world-...
spraff's user avatar
  • 299
5 votes
1 answer
1k views

Is placing z value of vertex in w enough to achieve perspective projection in OpenGL?

I have been learning about projection matrix in OpenGL and I am finding it really hard to understand. All I know is that there are other configurations in the projection matrix besides placing z in w ...
videogamechef's user avatar
5 votes
1 answer
835 views

Do straight lines always remain straight when projected with a perspective camera?

If I have a straight line in 3D space and I use a camera matrix to do a perspective projection into a 2D plane/screen will the resulting line always be straight too? If I project the start point and ...
Owen's user avatar
  • 53
4 votes
1 answer
2k views

Perspective correct interpolation z-buffer

While I was deriving expressions for perspective-correct linear interpolation on triangles, I reached the conclusion that the interpolation may be kept linear only if view-space $Z$ is available. ...
lightxbulb's user avatar
  • 2,226
4 votes
1 answer
930 views

Why perspective division ( div by w) when applying the inverse to a perspective transformation?

For example, when you want to compute the world space position of a fragment in the fragment shader, you can construct the fragment's NDC coordinates, then multiply by the inverse of whatever ...
cg_guy420's user avatar
  • 115
4 votes
1 answer
2k views

Inverse value in a Perspective Matrix

I am a new leaner of computer graphics. I'm trying to understand a code I found online and I got stuck in the following formula: ...
BossShell's user avatar
  • 143
4 votes
1 answer
1k views

How to derive Field of View (FOV) angles from a 2D projection

I'm looking for some guidance. I'm not sure if this is possible, and I'm not sure where to start. I need to measure the FOV angles of a first-person, 3D game using only gameplay screenshots. I'm bound ...
Brovidio's user avatar
4 votes
0 answers
174 views

Project grid on 2d plane based on camera perspective

Unsure if this is the right network to post this, but maybe someone can help... I'm working on a personal project where, with the help of AI, I want to automatically estimate the perspective of a ...
Chris's user avatar
  • 41
4 votes
0 answers
68 views

Is it possible to create a forced focus with a dual layer of images in order to Avoid eye strain with Virtual and Augmented Reality?

Would eye tracking allow for the alignment of a dual layered image (a google glass like device and a screen or projection) to provide a way to force the focus of the eyes into to a real life ...
Ryan's user avatar
  • 41
3 votes
2 answers
136 views

Supporting multiple camera types in a deferred renderer without specializing the shaders or in the shaders

Perspective Camera A (row-major) perspective transformation matrix has the following format: $$\begin{align} \mathrm{T} &= \begin{bmatrix} \mathrm{T}_{00} &0 &0 &0 \\ 0 &\...
Matthias's user avatar
  • 1,084
3 votes
2 answers
968 views

Which perspective projection matrix to use

I've seen two different perspective projection matrices being used but I want to know which one of them is the best. I think that they both output the same but I'm not sure. So if anyone can help me ...
Nixcc's user avatar
  • 33
3 votes
1 answer
219 views

Interpolate vertex attributes with $z$ AFTER homogeneous divide

Usually, if we want to interpolate some vertex attributes, say $A_1$, $A_2$ and $A_3$, we have to first divide them by their corresponding $z$ in view space, then we interpolate them using barycentric ...
Voko's user avatar
  • 269
3 votes
1 answer
461 views

Creating a vanishing point perspective shader

I have done my due hour of research before asking this question, it's a simple question, but I have found no hint at an answer online. I want the ability to extend an object infinitely in one ...
Orion Reed's user avatar
3 votes
3 answers
767 views

Point of view and rotation

Two questions which cross over maths/3D imaging/computer science. I'm trying to describe a point of view of an item in a 3d space and subsequently its rotation in a paper I'm writing. Versions I've ...
Garrett Lynch's user avatar
3 votes
1 answer
7k views

Calculate vanishing point

In perspective projection, group of parallel lines have the same vanishing point. I am interesting about the reverse calculation: Getting the group of parallel lines equations that their vanishing ...
nrofis's user avatar
  • 177
3 votes
1 answer
80 views

Camera model for rendering the viewport as a window frame?

I want to render as if someone is looking at a landscape through a window, adjusting for the viewer's head position. The landscape is easy enough (just a distant plane), but I'm not sure how to ...
Andrew Chatham's user avatar
3 votes
1 answer
398 views

Determining Vanishing Points of edges of Triangle using given Point

Due to perspective foreshortening, the projections of parallel lines (1D geometric objects) meet in their vanishing point (a 0D geometric object). Higher dimensional geometric objects also has higher ...
user2742934's user avatar
3 votes
0 answers
94 views

What vergence angle is commonly used for "infinitely far away" objects in stereoscopic displays?

I think that VR / AR experts will know the answer to this. At what vergence angle are "infinitely far away" objects such as star field textures drawn in head-mounted VR / AR displays ? I ...
Simon's user avatar
  • 183
3 votes
0 answers
215 views

Calculate Camera parameters and HandEyeCalibration

I'm trying to calculate camera paramters and a hand eye calibration (Transformation from camera to eye (display) coordinates) for rendering on a see-through HMD. I have already calculated a ...
user2479595's user avatar
3 votes
0 answers
86 views

Bilinear Transformation not working

I implemented this algorithm to fit given image to specified quadrilateral but the output is blank. I implemented it in C# as follows ...
Sandiip's user avatar
  • 173
2 votes
1 answer
131 views

Computing perspective directly

Assume the screen is axis aligned with origin at 0 and there is absolutely no view transformation. in other words we will simply try to project the model onto the screen plane following perspective. ...
Makogan's user avatar
  • 1,726
2 votes
1 answer
319 views

Deriving formula for perspective correct interpolation

I am trying to derive the formula for perspective correct texture interpolation on my own while implementing my own software rasterizer (projecting an arbitrarily rotated triangle in camera space on ...
Sam's user avatar
  • 164
2 votes
1 answer
477 views

Rasterizing spheres?

I want to start developing a hybrid renderer: it first applies a rasterizer, then stores for each pixel the surface pointer, normal vector, and distance to the camera. Then it raytraces reflections, ...
AnnoyinC's user avatar
  • 312
2 votes
1 answer
1k views

Why is the line from the camera to vanishing point parallel to the other parallel lines?

When trying to find the vanishing point of an image, why is it that the vector from the center of the camera to the vanishing point is parallel to the parallel lines of the image? What's the ...
Zack1234's user avatar
2 votes
1 answer
47 views

Getting from the default view volume to an image on the screen

I don't completely understand the last part of the MVP matrix (projection). In orthographic projection we simply scale the view volume into the default view volume (+-1 on all axis). In perspective ...
transporter_room_3's user avatar
2 votes
2 answers
2k views

Changing the projection reference point in Open GL

By default, the eye an the projection reference point PRP are in (0,0,0). I can change the eye position with gluLookAt(), but how can I change the PRP (i.e., the convergence position for a set of ...
Freeman's user avatar
  • 123
2 votes
1 answer
532 views

How to calculate camera distance so that after projective transformation a quad is filling the whole screen

First of all, I'm using OpenGL and GLM. Now, I have a square perpendicular to the z-axis and centered around it. Let's say that it has Z-value (offset along the Z-axis) X. Now, I want to set up a ...
thefunkyjunky's user avatar
2 votes
0 answers
88 views

Can anyone tell me why my projection perspective matrix isn't working?

I'm a beginner in WebGL and graphics programming in general. I'm trying to render procedurally generated terrain. My first stab at this seemed to work and I get the following result. I want to add ...
Andrew Lubrino's user avatar
2 votes
0 answers
204 views

physics/math of lighting gradient of a 3D object

Consider a monochrome ball. The colours of the pixels is a function of the point height, the light intensity, the light angle, and the surface material (reflection). What is the simplest formula ...
Googlebot's user avatar
  • 131
2 votes
0 answers
78 views

Project a Square as rectangle in projection plane using perspective projection

Consider a square S with vertices (1,1,0), (1,-1,0), (-1,-1,0) and (-1,1,0) and a plane P defined by $z=1$. Let the perspective projection of S on P is denoted by S'. What coordinates of the Center ...
Leolime's user avatar
  • 121
2 votes
0 answers
214 views

How to calculate solid angle subtended by a pixel?

How is the solid angle subtended by a pixel calculated? both in perspective and fish eye lens.
ali's user avatar
  • 740
2 votes
0 answers
285 views

Using GPU instead of CPU in Scala

I wrote a program that displays points expressed in 3D in a 2D canvas, using perspective projection. The aim is to display a cube. Each face of the cube is drawn by linearly interpolating the points ...
JarsOfJam-Scheduler's user avatar
2 votes
0 answers
261 views

How to project a view frustum in an orthographic cuboid?

I know that OpenGL uses a projection matrix to project the view frustum directly into the canoical volume [-1, 1]^3. But how would I project the frustum into an orthographic cuboid, which would then ...
imc's user avatar
  • 121
2 votes
0 answers
66 views

Perspective Translation Of Quadrilateral

I have mapped four rectangular point(R1->R4) to four quadrilateral points(Q1->Q4) to generate a perspective view. Now I have to translate quadrilateral in x and y direction while maintaing perspective ...
Sandiip's user avatar
  • 173
1 vote
5 answers
2k views

Existence of vanishing point

Consider the following example of perspective projection: I have one railway track with two parallel lines meeting at the point $X$ at infinity which is the theoretical approach. This X is called the ...
user avatar
1 vote
2 answers
302 views

Difference between perspective and parallel projection [closed]

We know that in orthographic Projection Projectors (projection vectors) are perpendicular to the projection plane. And in Perspective Projection Object positions are transformed to the view plane ...
user avatar
1 vote
1 answer
1k views

Why are vanishing point and centre of projection the same [closed]

We know that in perspective projection object positions are transformed to the view plane along lines that converge to the projection reference (center) point like this: But many websites say that COP(...
user avatar
1 vote
1 answer
44 views

In perspective projection matrices, why isn't $z_\text{eye}$ mapped linearly to NDC?

As far as my understanding goes, in projection matrices $x_\text{eye}$ and $y_\text{eye}$ are mapped linearly to NDC by first using proportions to find $x_n = \frac{n\cdot x_e}{-z_e}$ and $y_n = \frac{...
blvck_mvgic_dot_exe's user avatar