The projection-matrix tag has no usage guidance.
1
vote
1answer
36 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
22 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
37 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 ...
0
votes
0answers
43 views
Scaling geometry in an orthographic view
I'm having trouble understanding the results I'm getting from some of my matrix transformations. I've got an orthographic projection, and am drawing 2D circles on the screen. There is a camera matrix, ...
0
votes
0answers
95 views
How do I extract the right information from my projection matrix for frustum culling?
I've tried several different tutorials for Frustum culling, however I cannot understand them.
Here's my function that sets up my projection matrix (someone else helped me with this, but I don't know ...
9
votes
2answers
858 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. ...
3
votes
1answer
63 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 ...
0
votes
1answer
82 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
249 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 ...
0
votes
3answers
316 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
1k 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
113 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 ...
0
votes
0answers
61 views
How to convert Screen-space translation into World-space translation
private void Translate(SceneMouseMoveEventArgs args)
{
var camera = args.Camera;
origin_screenspace = camera.UnProject(_position).Xy;
cursor_screenspace = new ...
1
vote
0answers
384 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
110 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
174 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
119 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
680 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 ...
0
votes
1answer
242 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 ...