Questions tagged [camera-matrix]

38 questions
5
votes
1 answer

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 end point and join the dots is that equivalent to…
Owen
  • 53
  • 3
4
votes
1 answer

Camera Model View transformation in Ray Tracing

I am implementing my own simple ray tracing and I came across some sort of confusion. When defining the verticies in the world I multiply them by the modelView transformation system (the matrix similar to the one generated by glm::lookAt function)…
4
votes
1 answer

Modify camera matrix so that it renders a "chunk" of the frustum

Given a perspective projection matrix. How can one from it derive a set of matrices representing "chunks" of the viewport? So that the rendered chunks can be "stiched" to form an image "chunk times higher" resolution than the viewport. Here's an…
Facundo
  • 41
  • 2
4
votes
1 answer

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: topLeft = [-tan(vfov/2)*(output_width/output_height), -tan(vfov/2), 1]; Source looking on the internet I found that the…
BossShell
  • 143
  • 3
4
votes
2 answers

Correctness of logical steps for create the matrix of viewing transformation

In general, I understand the creation of viewing transformation matrix, but I have my doubts. For example, let's say that a world coordinate (called $A$) has a center at $(1,1,1)$, and the view reference point (VRP) (called $B$) has a center at…
Nick
  • 321
  • 1
  • 9
3
votes
0 answers

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 Projection matrix P (using SPAAM) which transforms points…
3
votes
2 answers

Correcting my "look-at" matrix so that it works on non-camera objects?

I'm familiar with the "look-at" matrix and the goal of being able to rotate a Camera at a specific location towards a specified target. When I tell the Camera to look at some target, there're no issues. However, when some other non-Camera object…
code_dredd
  • 166
  • 1
  • 7
3
votes
2 answers

My perspective projection is messed up?

So I've been messing with perspective projection matrices recently. I used numpy and GTK/Cairo to make a very small Python renderer. I'm very confused with the results I'm getting though. I took this Homogeneous Coordinates technique from an online…
divx
  • 41
  • 4
3
votes
1 answer

Inverted yaw angle in the view matrix

I'm trying to construct a FPS view matrix for my OpenGL renderer using yaw and pitch angles instead of the typical LookAt view matrix. The view matrix is the inverse of the camera world transform $\mathbf{M}_{\textrm{view}} =…
user5488
  • 156
  • 1
  • 4
3
votes
1 answer

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 approach the window frame. It seems like I want…
2
votes
1 answer

Difference between a spherical camera and a trackball camera

A spherical camera is pretty easy to define. We have an anchor point C the camera always looks at and a relative position P where the camera is, which can be expressed in spherical coordinates, centered around the point C. In this type of camera the…
Makogan
  • 1,584
  • 8
  • 27
2
votes
0 answers

With OpenGL, is it correct to apply model transformation to rotate the camera?

Having taken a basic CG course, I remember that transformations are relative, so rotating the camera is identical to rotating the view in the opposite direction. Right now I want to implement camera rotation using the mouse. In OpenGL, I can see the…
iksemyonov
  • 121
  • 2
2
votes
1 answer

Building a lookat camera matrix

I was reading this article and found something that caught my attention. They say they are using column-major for their matrices so, in the code they have under the section Look At Camera they construct the orientation and…
BRabbit27
  • 969
  • 1
  • 10
  • 20
2
votes
0 answers

Finding Camera projection matrix from known input and output

Lets say I have a rectangle with known coordinates in 3D scene, and I'm projecting it using pin point camera to the plane (screen). You can imagine it deforms on the screen per camera transformation and projection. And I know the resulting project…
2
votes
1 answer

Is it possible to make a projection matrix to not project in the center?

I have the following projection matrix: and I need to make a hole in the center of my matrix, something like that: (I don't want to project a custom W and H) Is that possible ? Thanks.
1
2 3