Questions tagged [projection-matrix]

234 questions
0
votes
0 answers

Projection matrix which maps 4 arbitrary eye coords to fill the viewport?

Given 4 points in eye coordinates (call them ABCD), all of which are in front of the camera (Z<0), how can I calculate a 4x4 projection matrix that will project points ABCD exactly onto the 4 corners of the viewport? The goal is to make an…
Roofus
  • 584
  • 6
  • 17
0
votes
1 answer

Correlation between OpenCV Camera calibrate matrix to OpenGL Projection matrix

I'm having quite a hard time to render a .stl model with the same dimensions and proportions visualized in the picture of the real object. I put the real object at the centre of the view area and I would like to flip between the model and the real…
0
votes
1 answer

Sampling the depth buffer and normalizing to [0,1] (DirectX)

I'm trying to visualize (for debugging purposes) the depth of a scene on a textured quad (I want to display the depth of a water pond onto the surface of the water). So what I'm doing is rendering the scene from camera point of view in a depth…
Luca
  • 1,658
  • 4
  • 20
  • 41
0
votes
1 answer

LWJGL2 projectionMatrix does not work for me

before showing my code I want to explain the Situation a littlze bit. I am trying to make a FlappyBird clone just for practice using Lwjgl2. Right now I am able to create a textured Quad which can move ONLY in x and y direction and rotate around all…
J.Doe
  • 125
  • 1
  • 1
  • 10
0
votes
1 answer

How can I access ProjectionMatrix in three.js directly?

How can I access the perspective camera's projection matrix directly and change one or more of the 16 values? I tried the code bellow with and without .updateProjectionMatrix() and it doesn't work, probably it is overiden by an internal…
user5515
  • 301
  • 2
  • 18
0
votes
1 answer

3d perspective projection with camera rotation

I am developing now a 3d game engine (Very simple, just cubes and maybe few other simple 3d objects). I am using C++, and for the graphics SFML, it's 2d graphics library for C++. I already have the formula for the perspective projection: S will be…
user9043613
0
votes
0 answers

Camera Calibration - How To Find The Projection Matrix

There are many questions that explain how to find the projection matrix but they don't apply to my situation. The Matlab function cameraMatrix(cameraParams,rotMatrix,tranVector) can easily find the projection matrix. I obtained my cameraParams…
0
votes
1 answer

Implementing arcball rotation axis without projection matrix?

I have a question about implementing the arcball in opengl es, using Android Studio. After calculating the rotation axis, I should reverse the axis through the rendering pipeline back to the object space, so that the rotation could be applied in the…
migodaet
  • 51
  • 4
0
votes
0 answers

Rotating a projection matrix

In an OpenGL game, I am trying to rotate the camera relative to the player's view. This rotation is not easily defined by relative angles, but rather easily defined by relative forward/up/left vectors. How do I construct a matrix such that I can…
Shaun Lebron
  • 2,501
  • 28
  • 29
0
votes
1 answer

libgdx - GLGS - Create vertex shader which let objects wave

I have some Mesh-Objects like a flat rectangle: private void generateMesh(float xshift_mesh, float yshift_mesh, float zshift_mesh, float size_mesh) { float size = size_mesh/2; mesh = new Mesh(true, 4, 6, VertexAttribute.Position(),…
goulashsoup
  • 2,639
  • 2
  • 34
  • 60
0
votes
0 answers

Projection Matrix - Horizontal Perspective, Vertical Orthographic

Is it possible to create a projection matrix that is horizontally perspective, yet vertically orthographic? I am trying to create a game in Unity (2D) and am just learning about projection matrices. If you look at an engine like Construct 2, it…
jonesy19
  • 139
  • 1
  • 16
0
votes
0 answers

Problems implementing perspective projection in 3D graphics, (d3d)

I'm having massive difficulties with setting up a perspective projection with direct x. I've been stuck on this for weeks, any help would be appreciated. As far as I can my pipeline set up is fine, in as far as the shader is getting exactly the…
AndyW
  • 101
  • 1
  • 2
  • 12
0
votes
1 answer

OpenGL when switch fron 2D to 3D

Here's what I want to achieve, I have a flag called switch_2D_3D in the code below, and when it's true I switch to 2D mode, otherwise 3D. void reshape(GLsizei width, GLsizei height) { if (switch_2D_3D) { // GLsizei for non-negative…
RushSykes
  • 41
  • 1
  • 9
0
votes
0 answers

Object projection in openGL ES 2

I want to draw object within ar but got unexpected result - gl mashine think that i see object from another side (or from inside). Here image what i want to draw (taken from separate project) And here - what i got when try to draw this object in…
hbk
  • 10,908
  • 11
  • 91
  • 124
0
votes
1 answer

OpenGL ES 2.0 (specifically for the iphone) rendering is slightly off. Best guess is it's a projection matrix problem

So I bought O'reilly's Iphone 3D programming and found what I believe to be a bug in there code. However I can't figure out what the problem is, and unless I do I can't move forward with my own code. I will paste what I consider to be the…
Alex
  • 1,977
  • 3
  • 13
  • 20