4 votes
Accepted

Camera Model View transformation in Ray Tracing

The space at which you transform your vertices is completely up to you, because it depends on what algorithms and kind of effects that you are trying to achieve. As of my personal experience, I ...
vgs's user avatar
  • 311
4 votes
Accepted

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

It's not possible to cut a hole in the image by altering the projection matrix, no. However, you can mask out rendering in that region by using the depth test or stencil test. For example, before ...
Nathan Reed's user avatar
  • 24.8k
3 votes
Accepted

Building a lookat camera matrix

Because all matrices are column-major, the translation matrix $\mathbf{T}$ should be $$ \mathbf{T}=\begin{bmatrix} 1 & 0 & 0 & e_x \\ 0 & 1 & 0 & e_y \\ 0 & 0 & 1 &...
TheBusyTypist's user avatar
3 votes
Accepted

Is there a better, more elegant way of translating/rotating my camera in my 3d raymarched world or am I stuck with trigonometry?

A reliable way of getting the forward/left directions relative to the view is to use the camera rotation matrix itself to produce forward, Up and right vectors. ...
PaulHK's user avatar
  • 2,312
3 votes
Accepted

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

"A not so simple approach". I may have messed a little bit too much with grouping the terms, do forgive my elementary math skills, it's a side effect of using tools like wolfram and mathematica too ...
lightxbulb's user avatar
  • 2,083
3 votes

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

It depends a little how you construct the matrix. I assume that you use the function perspective_matrix from your library, which actually works pretty much like ...
Christian Rau's user avatar
2 votes

Correctness of logical steps for create the matrix of viewing transformation

I would like to address an issue in your naming. This issue makes the question a bit odd, but not impossible, as I will try to show. There is an, often unspoken, implied relationship between the ...
joojaa's user avatar
  • 8,397
2 votes

Correctness of logical steps for create the matrix of viewing transformation

I'm assuming you mean $A$ is object$\rightarrow$world matrix and $B$ is your camera$\rightarrow$world matrix? If that's the case, to calculate object object$\rightarrow$camera matrix you calculate: $$...
JarkkoL's user avatar
  • 3,616
2 votes

My perspective projection is messed up?

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 &...
user18490's user avatar
  • 656
2 votes
Accepted

My perspective projection is messed up?

The math for the projection matrix is (with fov as $\alpha$): $q \leftarrow \frac{1}{tan(\frac{\alpha}{2})}$ $a \leftarrow \frac{q}{aspect}$ $b \leftarrow \frac{(...
code_dredd's user avatar
2 votes
Accepted

How to rotate a camera?

Promoting my comment into an answer since it identified the problem... The issue is confusion between degrees and radians for the angle parameter. GLM, up to version 0.9.5, was very inconsistent in ...
russ's user avatar
  • 2,372
2 votes
Accepted

Inverse value in a Perspective Matrix

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 ...
gallickgunner's user avatar
2 votes
Accepted

Objects in depth buffer are always black (0.0)

That's how I used to initialize viewport (CD3DX12_VIEWPORT). But I didn't realize that there are two additional fields minDepth and maxDepth. Therefore, I have min/max depth set to 0.0 and objects ...
DirectX_Programmer's user avatar
2 votes
Accepted

Given two 3d vectors, find the rotation matrix between the two

You can construct a rotation matrix from an "axis", or 3 vectors. This is done by calculating 3 direction (normalized) vectors for the 3 axis of our new rotated coordinate system, they are ...
PaulHK's user avatar
  • 2,312
2 votes
Accepted

Shear(?) matrix projection along Z (depth) axis

I belive what you are looking for is a scale Matrix, or actually it will end upp with as a shear matrix for you. Usually they look like this ...
the1bird's user avatar
  • 126
2 votes
Accepted

How do I perform a perspective transform on a straight line?

There are many methods you could use to go about doing this, here is one using the parametric form of a line which is: $L(t) = p+t\vec v$ Where $p$ is a point on the line and would be stored as a 4 ...
pmw1234's user avatar
  • 3,030
1 vote
Accepted

Unknown array of floating point numbers. View matrix?

Yep, that looks like a view matrix. A matrix can be stored in either row- or column-major order; that one appears to be column-major. As you’ve identified, the last row / column of it (the values you’...
Noah Witherspoon's user avatar
1 vote

Camera model for rendering the viewport as a window frame?

The magic phrases for what I'm trying to achieve are "oblique frustum", "asymmetric projection", or "off-axis camera". I haven't implemented it in three.js but achieved ...
Andrew Chatham's user avatar
1 vote

How to use trackball for rotating an camera matrix in eye frame

I'm assuming the rotation matrix generated from the arcball is 2D, so I think there are a few clear top level steps. But I'm not sure about the details of some of them. First you'll need to extend the ...
luser droog's user avatar
  • 1,343
1 vote
Accepted

Can pixels on the image plane be mapped to world space coordinates?

What you are asking about is 'mouse picking'. If a user clicks a pixel on the screen how can you get corresponding world space coordinates of an object being clicked on. Imagine a ray from that pixel,...
Gabriel Rohweder's user avatar
1 vote

Translate an arcball camera upwards or left-right

Here's a basic camera with panning (some parts removed for brevity). It's not arcball but should get the idea across. Basically it just transforms some directions of a plane in view space to one that ...
Andrew Wilson's user avatar
1 vote
Accepted

Is there something wrong with a column camera matrix?

It was getting a little big to fit in the comments so posting it as an answer instead. Might not be a solution to your problem but the concept is related. People usually forget that whenever you ...
gallickgunner's user avatar
1 vote

Is there something wrong with a column camera matrix?

What you have there is the matrix that goes from eye space (camera space) to world space. You can see this by observing that, for instance, if you apply this matrix to the column vector $[1, 0, 0, 0]^...
Nathan Reed's user avatar
  • 24.8k
1 vote

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

Both the question and its answer is confusing. First of all the matrix you have is a column "Look at" view matrix rather than a model matrix. A correct column "Look At" model matrix would be $$\...
3D clipping.'s user avatar
1 vote

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

You don't seem to get the concept right: A look-at camera matrix is created by defining two points, the "from" point (the dog eyes for example assuming you take the position of the eyes of the dog ...
user18490's user avatar
  • 656
1 vote

Inverted yaw angle in the view matrix

It's happening because they just happened to define the rotation matrix with counterclockwise rotation direction, which is the common convention for polar$\rightarrow$cartesian coordinate system ...
JarkkoL's user avatar
  • 3,616

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