The projection-matrix tag has no usage guidance.
0
votes
1answer
35 views
Problem calculating screen point for a point in a 3D world with view matrix and projection matrix
I am trying to calculate the 2D screen point of a 3D world position. For this I use the multiplication ViewMatrix * ProjectionMatrix. But I am not getting good results and I think I am messing up my ...
0
votes
0answers
30 views
How can I calculate a corrected oblique clipping matrix?
This problem has been eating at me for a little while now, and it's extremely frustrating.
Unity calculates culling matrices incorrectly. From the matrix, it seems to generate the actual occlusion ...
4
votes
0answers
41 views
How to clip cut-off using different frustrum than that of original camera? How to cut plane by pyramid shape?
SOURCE : http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/Mitchell_LightShafts.pdf
This process is part of creating light draft effect. And I am suggested to do the described process in ...
0
votes
0answers
51 views
Perspective Projection Frustum Visualization
I've been literally struggling the last 2 weeks to get frustum culling to work with my 3D viewer. I've literally read every single reference and article out there, but for some reason I can't get it ...
4
votes
1answer
49 views
OpenGL Perspective Issue
I'm trying to troubleshoot a problem with my simple OpenGL test program, which I've written in C. I've written some math routines to do the matrix manipulation, but even after copying known working ...
0
votes
0answers
20 views
LWJGL projection matrix streches stuff
I would like to know how I should set my projection matrix to make my drawn elements look good in relation to the window size. Currently my proj matrix is like that:
proj_mat.ortho(-10.0f, 10.0f, -10....
3
votes
2answers
247 views
360 degree video of my OpenGL game
I want to make a 360 degree video of my OpenGL game.
Concerning the rendering: Is it enough to render it in OpenGL with a specific projection matrix? If yes, which one? Or can I render it into a cube ...
1
vote
0answers
39 views
Convert box to matrix
I have a box (non-rectangular cuboid?) and would like to convert it to a matrix such that when a point inside the box is multiplied by the matrix, a vector is returned that describes the relative ...
2
votes
1answer
572 views
libGDX - Why do I have to use camera.setToOrtho what does it do?
I am very confused about camera matrices and I don't know where to start my studying. Maybe I have to study OpenGL, but I don't know C++ ...
Ok so I have a camera, Box2d world and a Box2d body.
...
1
vote
0answers
113 views
How to achieve the top-down (oblique) projection of textures using an OrthographicCamera?
This question is related to (How to calculate the initial velocity of projectile motion by a given distance and angle from point A to B) question.
Details
In the below image is the graphical ...
0
votes
0answers
35 views
How to locate camera facing down with gluLookAt equivalent?
My world is a field. The coordinates and the axis are described in the image below:
I want to locate a camera above the field, at location C=(W/2,H/2,-Z1), facing down. The extrinsic matrix RT that I ...
1
vote
1answer
51 views
2D World Mouse Coordinates - Matrices
I'm trying to get the world coordinates out of a mouse click. Currently I'm doing the following:
var invertedMatrix = mat4.create();
var viewMatrix = activeCamera.getMatrix();
mat4.invert(...
0
votes
1answer
57 views
Calculate camera target
How calculate camera target position, if I have front/back planes, camera transformation matrix and camera lens length?
0
votes
1answer
222 views
Project camera-to-pixel ray in world coordinates
I'm trying to implement a very simple ray tracing function but I have a problem with projecting the camera ray (from camera to pixel) to the world space.
In the screen coordinates have the pixel ...
0
votes
1answer
43 views
Does a Standard Exist for Game Entity View Frustums
I was just recently adding the ability for my in-game entities to have their own Frustums, with the intentions of making them able to see enemies later down the road of my development cycle. My custom ...
1
vote
0answers
135 views
Control frustum near and far clip plane sizes in a Projection Matrix
I'm trying to achieve a dolly zoom effect.
My first try was the obvious one, the original "zoom in & dolly out" technique, which works nicely.
Except that there are cases which this is not ...
1
vote
1answer
57 views
What are projection independent ways of determining whether a normal is facing the viewer?
A position v and normal n are given in world coordinates. Also there is a view matrix V for world-eye coordinate transition and a projection matrix P for eye-ndc transition. I would like to determine, ...
0
votes
1answer
98 views
Projection Matrix Breaks My Rectangle
This is my vertex shader, shown below.
#version 330 core
in vec3 a_position;
in vec4 a_colour;
// FOV = 70, near plane = 0.1, far plane = 1000
const mat4 u_projection = mat4(
1.428148, 0.0, 0.0,...
1
vote
1answer
118 views
HLSL pixel inside a view (cascaded shadowmapping)
I'm figuring out shadowmapping in HLSL (see also this question). I understand that I need projection matrices for each cascading shadowmap.
I use this code to create the projections:
Matrix ...
1
vote
1answer
177 views
Converting normalized device coordinates to world space coordinates flipping my sprites
I'm trying to convert my game's camera system to use world space coordinates rather than OpenGL's default normalized device coordinates, however in doing so my sprites are being rendered improperly as ...
1
vote
1answer
40 views
Last Row of the perspective projection matrix
Could you explain to me what is the purpose of -1 in the last row of the gl_projection matrix? And how it affects the perspective division step ?
2
votes
1answer
66 views
Shaders wont bind to the uniform block
I'm having an issue with interface block binding.
Example shader:
const char* vertexShader =
"#version 330 core\n"
"uniform globalMatrices"
"{"
" mat4 ...
9
votes
2answers
1k views
Why do we need a fourth coordinate to divide by z?
I read the response here:
What does the graphics card do with the fourth element of a vector as the final position?
"The fourth component is a trick to keep track of perspective
projection. When ...
5
votes
2answers
106 views
How do I create a half-ortho half-perspective projection matrix
I've been trying to make a formula for the projection matrix where your vertical axis is projected orthographically but your horizontal axis will have perspective to it.
So the view frustum would ...
1
vote
1answer
218 views
OpenGL: How to map point inside frustrum to normal device coordinates (NDC)?
I read this article http://www.songho.ca/opengl/gl_projectionmatrix.html.
It's explain how calculate projection matrix coefficients.
But I completely can't understand how author perform mapping from ...
9
votes
4answers
817 views
How do I correctly project a point behind the camera?
I am making a 3D game in which I put an exclamation marker above points of interest.
In order to find out where in the 2D screen should I put my marker, I am manually projecting the 3D point where ...
1
vote
3answers
1k views
Why should i set glClearColor and setProjectionMatrix in render method many time in LibGDX?
import com.badlogic.gdx.Game;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class MyGame extends Game {
public OrthographicCamera ...
2
votes
2answers
4k views
How can I set up an intuitive perspective projection/view matrix combination in OpenGL, using GLM?
Could anyone help me set up an intuitive perspective camera matrix using OpenGL and the GLM library?
By "intuitive" I mean that I want the camera to be looking at the middle of the screen down the -Z ...
1
vote
2answers
244 views
OpenGL: Is it efficient ok to glPushMatrix, plMultMatrix, plPopMatrix for every object in my scene?
I'm very new to opengl, and I might not fully understand the openGL matrix projection stack thing.
So, I have about 300 'objects' in my scene, each with their own position/rotation, and I want to ...
1
vote
0answers
788 views
How can I get shadows to appear correctly when using a custom projection matrix?
EDIT:
This has been officially marked as a bug in Unity. If anyone else has this issue, you can vote here for Unity to fix it.
As mentioned in this thread, I'm using a custom projection matrix in ...
2
votes
1answer
201 views
Why does the projection matrix transform object points into a unit cube in computer graphics?
This semester I both took a computer vision and a computer graphics seminar. But only now before the exams I realize that there seems to be a fundamental difference between projection in both topics.
...
0
votes
2answers
440 views
Z-Value of clip-space position is always 1.0
I render a lot of quads on the screen into z direction (20 x 2000). I want to get the depth value in a final render target. But it looks like z is always 1.0f. I checked the result with the OpenGL ...
1
vote
1answer
191 views
How to position a Weapons model in a first person shooter with XNA
I am building a first person shooter and positioning the weapons is hard. I am trying to get the bat to look like you are holding it but I keep trying things and they don't appear in the positions I ...
1
vote
2answers
2k views
How can I pass a std::vector<Vector3f> to my shader?
I have a Vector3f type which has x, y, and z properties. I have a std::vector of these vertices which describe my terrain.
I would like to pass these values to a vertex shader through a uniform ...
1
vote
1answer
536 views
Offset a camera/render without changing perspective
I need to offset a render so that the perspective / vanishing point doesn't change. Or another way to look at it is that I need to adjust the vanishing point in my view so that instead of being at 0,...