Questions tagged [projection-matrix]

234 questions
0
votes
0 answers

How to calculate a projection matrix for nonnegative constrained least squares?

Suppose we have a data vector z in R^p and a training data matrix X in R^(p*N), where N (N>p) is the number of samples in the training data matrix. If we'd like to find the projection of z to the linear subspace spanned by the columns of X, then we…
0
votes
1 answer

Changing the angle in glm::perspective reflects the object

I was drawing 2 cubes on the screen and I realized that my object behaves really weird when I changed the angle in the perspective matrix, here is my code glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glUseProgram(programID); GLuint mvp =…
demalegabi
  • 577
  • 6
  • 19
0
votes
0 answers

3D Cube OpenGL - How Do Cube Sides Show When the Camera Moves?

I am following a tutorial on YouTube which combines 3 matrices: projectionMatrix * viewMatrix * transformationMatrix. These, allow a 3D cube to render along with a camera that controls the scene. My question is, how do these matrices/matrix show the…
0
votes
1 answer

What Does orthoM() Do Under the Hood?

I've read the documentation and it says it creates an orthographic projection matrix. However, what does the matrix it uses for calculations look like? I input values into the method: 0, 105.0, 495.0, 190.0, 410.0, 0, 1 and it outputs:…
user3704920
  • 617
  • 1
  • 8
  • 19
0
votes
1 answer

projecting Tango 3D point to screen Google Project Tango

Ptoject Tango provides a point cloud, how can you get the position in pixels of a 3D point in the point cloud in meters? I tried using the projection matrix but I get very small values (0.5,1.3 etc) instead of say 1234,324 (in pixels). I include the…
Girauder
  • 165
  • 1
  • 12
0
votes
1 answer

DirectX Stereoscopic Projection Transformation for 3D Perception

I am trying to Change my Monocular DirectX Engine into a Stereoscopy Renderengine for Oculus Rift. What is missing, is the Stereoscopic Projection Transformation to achieve a 3D Perception. For now, I am using still my Standard monocular projection…
Max
  • 35
  • 2
  • 7
0
votes
1 answer

Getting ModelView and Projection matrices in Opengl 2.x [C++]

I know that StackOverflow is full of similar questions (Like this one or that one) but the solutions given don't seem to work for me. My goal is to use gluProject to get the screen coordinates of some point from the 3D-space. Before that, I'm…
JuanGM
  • 25
  • 9
0
votes
0 answers

Project a 3D point on a frustum with opencv

I have a frustum which is defined like this : his origin is (0, 0, 0), I know his orientation (heading, pitch, roll) I know his bottom angle, his top angle, his left angle and his right angle. I have a cv::Point3d and I would like project the…
artoon
  • 729
  • 2
  • 14
  • 41
0
votes
1 answer

Matrices and projection in webgl

// Upload Projection, ModelView matrices gl.uniformMatrix4fv(shaderProgram.uMVMatrix, false, pMVMatrix); gl.uniformMatrix4fv(shaderProgram.uPMatrix, false, perspM); In the above lines, I understand that the projection matrix and modelview matrix…
userJS
  • 119
  • 1
  • 14
0
votes
1 answer

3D : keep horizon drawn on screen at the same height regardless camera's zoom

I have this strange use case. These variables are known: Camera zoom (or fov) Camera rotation (orientation) around Y and Z axis = 0 Now, I want the horizon (horizon position = (0,0,Infinite)) to be drawn on screen at a specific 2D height "YY".…
Bill Kotsias
  • 3,258
  • 6
  • 33
  • 60
0
votes
1 answer

Perspective projection seems wrong, closer parts of a model appear smaller and vice versa

I'm trying out D3D11 and struggling to render a model correctly. Here's my problem; while my world and view transformations seem right, my perspective transformation seems to be wrong. When I first rendered a model, something felt wrong, so I tried…
0
votes
1 answer

OpenGL 3D Transformation: z-Aspect ratio

I'm doing 3D perspective projection in OpenGL (webgl), doing it myself with uniform-matrices. Everthing is working fine, but I have an aspect ration of 3:2 (600px x 400px) and this distorts all geometry rendered. In 2D I used to fix this in the…
elfeck
  • 385
  • 1
  • 8
0
votes
2 answers

Converting coordinates between 2 projection matrixes

I am writing a game using Java with LibGDX and Box2D libraries. The screen contains 12*7 blocks, landscape, so I use orthographic camera with 12 and 7 as wiewport width and height. Also, Box2D world uses this camera. The window screen sizes are…
0
votes
0 answers

View-Projection matrix, meaning of Z

I'm projecting 3D points with X,Y,Z model coordinates to X,Y image coordinates using a 4x4 perspective view-projection matrix. There is only one model, so it is like a MVP matrix where the M matrix is unity. Is it possible to extract the coordinates…
tmlen
  • 8,533
  • 5
  • 31
  • 84
0
votes
1 answer

How can I get the camera space position on the near plane from the object space position

As titled, I have an item with a specific position in object space defined by a single vector. I would like to retrieve the coordinates in camera space of the projection of this vector on the near clipping plane. In other words, I need the…
elect
  • 6,765
  • 10
  • 53
  • 119