Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes

360 degree video of my OpenGL game

For performance reasons GPUs use some simplified approach to projection and assume that you want to project your geometry on a plane, so it works only for FOV angles < 180 deg. You could try some ...
kolenda's user avatar
  • 1,370
4 votes
Accepted

How do I create a localtoworldmatrix and worldtolocalmatrix in Godot?

In Godot a Transform3D has no concept of local or world. They are transformations between spaces, and what those spaces are depend on how you use them. For a ...
Theraot's user avatar
  • 27k
4 votes

How does glm::lookAt produce a View Matrix?

Alright so upon looking into it further, here's how glm::lookAt produces a View Matrix: Make a row-major ordered 4x4 Translation Matrix by negating the camera position, c: ...
Ian's user avatar
  • 61
3 votes
Accepted

Does a Standard Exist for Game Entity View Frustums

There isn't really a standard - it's going to be dictated by the needs of your gameplay. For Splinter Cell, determining whether the player (or suspicious evidence) is seen by an AI is the heart of the ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

libGDX - Why do I have to use camera.setToOrtho what does it do?

setToOrtho does not set the projection type of the camera. An OrthographicCamera will always have an orthographic frustrum. ...
spectacularbob's user avatar
2 votes

OpenGL Perspective Issue

This was caused by an uninitialized variable being fed into the projection function: ...
Brian's user avatar
  • 151
2 votes

What are some standard mathematical tests for projection matrices?

A few ideas: Any point in front of the camera along its central axis should get mapped to (0, 0) after the perspective division. Any point selected on / outside the camera's view frustum/prism should ...
2 votes
Accepted

What exactly does XMMatrixPerspective{L,R}H do?

The DirectXMath library is all inline so you can look directly at the source. For example, here is the C version of XMMatrixPerspectiveLH: ...
Chuck Walbourn's user avatar
2 votes

libGDX - orthographic camera and world units

I would recommend re-reading the post as I don't think you completely understand why you're setting up an orthographic camera. The whole point of this is to move away from pixels and move towards ...
Nybbit's user avatar
  • 121
2 votes
Accepted

OpenGL frustum extraction

In openTK you need to transpose matrices to make it work. Green lines are frustum in world space. ...
some rand's user avatar
  • 118
2 votes
Accepted

How to visualize angle of projection in Oblique Parallel Projection?

On OP request, I'm posting the images I produced as answer. These were made with Sketchup. They show a cube a plane where the cube is projected in an oblique projection. The blue sectors represent the ...
Theraot's user avatar
  • 27k
2 votes
Accepted

Can I get world-space z-near-plane vertices from projection matrix + z-near distance?

Thanks @DMGregory for the pointer in the comments. I'm constructing a fullscreen quad at (x, y, -1, 1) in NDC. Notice z = -1 is ...
kaoD's user avatar
  • 1,935
2 votes

Texture flipping behaviour

In OpenGL, by convention, the bottom-left, not top-left, is the origin (0,0). See also Why is OpenGL point (0,0) not in top-left corner of the screen?
Maximus Minimus's user avatar
1 vote
Accepted

glm::frustum vs glm::perspectiveFov

When you use perspectiveFov, the angle of spread in the vertical direction is set by the fov parameter, and the horizontal angle ...
DMGregory's user avatar
  • 135k
1 vote
Accepted

When moving the "camera" should one move the projection matrix or move the world?

OpenGL and Scratchapixel do not state that you need to move the world. The editors of the documents you are referring to spent a great deal of time explaining the process in detail and you are ...
user18490's user avatar
  • 132
1 vote

When moving the "camera" should one move the projection matrix or move the world?

You move the world because there is no camera. The camera is a useful analogy in tutorials, but it's important to understand that an analogy is all that it is: it doesn't actually exist in any 3D API. ...
Maximus Minimus's user avatar
1 vote

When moving the "camera" should one move the projection matrix or move the world?

First, the matrix in question is the "view matrix," which yields the scene coordinates relative to the camera. The "projection matrix" is responsible for the actual warping of the ...
the_Demongod's user avatar
1 vote

Combining cylindrical Billboarding and aligning with velocity (unity)

Finally got it right ! Got it by trying to learn more about those matrices. I needed to use the direction vector between particle position and camera as a forward vector Here's the code for those who ...
JingleSpell's user avatar
1 vote

Confused about why my projection matrix works

Probably your intended nearplane and farplane variables mapped reversely.So it clipped out eveything that supposed to be rendered on the screen. Possible Reasons (Possible)There might be a transpose ...
Roveldo's user avatar
  • 76
1 vote

How does a game like Enter the Gungeon handle forward and backwards movement with their orthographic set up?

So, this screenshot (linked from the Reddit thread you linked) helps clear things up: https://twitter.com/DodgeRollGames/status/593625936131653632/photo/1 Their camera points directly down Z (...
D0SBoots's user avatar
  • 251
1 vote

How to set the camera projection matrix so that its 4 rays always exactly hit the corners of a defined rectangle?

What I understand is that you are trying to create a non-stereoscopic background to represent a very far view in the background in a stereoscopic view. I would try creating a multi-camera setup ...
Guney Ozsan's user avatar
1 vote

How to set ortho projection / model view matrix without a camera?

Ended up going with this. Based on this documentation. ...
David H's user avatar
  • 11
1 vote

set zfar/znear in openGL using shaders (QT env)

You can't make OpenGL render to infinity. The depth buffer usually uses floats (it can use other types, but none of them can represent an infinite number of values), meaning it has a set precision. If ...
Bálint's user avatar
  • 14.9k
1 vote

OpenGL orthographic projection rendering quarter of screen

I think I figured this out. I am calling glViewport with the window dimensions, but I believe it should be the framebuffer dimensions. In my case, the framebuffer was four times the size of the window....
user124369's user avatar
1 vote

How to keep an object in a certain part of the camera view?

Take a look at the lookAt matrix : https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/lookat-function I can't explain to you myself as I use a matrix library for this, but ...
Paul Boursin's user avatar
1 vote

Why are the vertices from a mesh not transforming using a camera?

First of all, I haven't looked through all that code, but my first guess would be this line in the shader: output.position = mul(worldViewProj, position); If ...
János Turánszki's user avatar
1 vote

Problem calculating screen point for a point in a 3D world with view matrix and projection matrix

Matrix multiplication is non-cumulative, aka A * B doesn't always equal to B * A. The order of the multiplications should be <...
Bálint's user avatar
  • 14.9k
1 vote

How to clip cut-off using different frustrum than that of original camera? How to cut plane by pyramid shape?

For a simple way of doing it, you’ll need two things: First, you’re looking for the Sutherland-Hodgman Clipping algorithm, or some other type of clipping algorithm. Sutherland-Hodgman is very easy to ...
Jon's user avatar
  • 534
1 vote

360 degree video of my OpenGL game

You could also try Dual Paraboloid mapping. The idea is that you render your scene two times with a paraboloid projection - once for front and once for the back paraboloid. If you render the front and ...
János Turánszki's user avatar
1 vote
Accepted

2D World Mouse Coordinates - Matrices

Ok mystery solved. The issue was because I wasn't normalizing the mouse x and y before applying the calculations. After doing the following everything started to work correctly: ...
João Alves's user avatar

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