Questions tagged [glm]
GLM is a C++ math library based on the GLSL language.
154 questions
1
vote
0
answers
47
views
CGLM Not Rendering with Sokol [closed]
I've setup cglm from a wrap configured with Meson, and have copied one of the samples from https://github.com/floooh/sokol-samples/tree/master (cube-sapp, to be exact). I've tried to replace sokol's ...
1
vote
0
answers
72
views
Cannot transform vectors from viewport to world
I started working on a small raytracer project, and i decided to reuse my already existing openGL renderer to do this, i'm using GLM to manage transforms/positions.
However, i stumbled upon a very ...
0
votes
0
answers
97
views
Bullet physics incorrect rotation with more than one axis
im try to integrate currently bullet into my game framework. But when i try to set the rotation for an rigidbody with more the 1 axis i recive the current result
It looks that the rotation is ...
0
votes
1
answer
1k
views
glm::frustum vs glm::perspectiveFov
When I use glm::perspectiveFov(90.0f,512.0f,512.0f,1.0f,256.0f) I receive a working perspective projection with 90° in both x and y, as seen below (camera is in ...
0
votes
1
answer
145
views
Transforming a ray to NDC coordinates
I am trying to have ray tracing with a mesh using NanoRT and I want to be able to allow for a model transform on top of my view and projection transforms.
I have successfully transformed my ray from ...
1
vote
1
answer
834
views
Implementing a Maya-like orbit camera in Vulkan/OpenGL
I want to create an orbit camera with zooming, panning, and rotation. I used the following examples to create cameras:
https://stackoverflow.com/questions/54400422/how-to-implement-altmmb-camera-...
0
votes
0
answers
61
views
How to calculate angles after subsequent rotations?
I have a class that manipulates a model matrix in opengl:
...
1
vote
1
answer
1k
views
How is the GLM '*' operator on quaternion and vec3 defined?
Using the definition of quaternion rotation given here:
So the equivalent code in GLM of the above formula would be like this:
...
1
vote
1
answer
1k
views
Applying incremental rotation with quaternions: flickering or hesitating
I'm having a couple of problems while rotating an object every frame with GLM.
First problem
I'm trying to rotate the object with a small increase using quaternion multiplication.
...
0
votes
0
answers
797
views
What am I doing wrong with this GLM camera rotation?
I'm attempting a very basic camera with GLM in C++ that has full pitch and yaw rotation. The game I'm planning to make will eschew triangles in favor of flat scaled/rotated sprites to represent ...
0
votes
1
answer
754
views
Why clip in clip space - confusion with Gribb-Hartmann clip plane extraction
I understand to extract clip planes from the perspective matrix one can follow the methodology laid out by Gribb-Hartman as documented here:
http://www.cs.otago.ac.nz/postgrads/alexis/planeExtraction....
0
votes
1
answer
537
views
Calculating child world translation, rotation and scale
I'd like to know if it's possible to calculate a child's world translation, rotation and scale individually. I'm used to seeing devs resorting to matrix multiplication and then decomposition, like so:
...
1
vote
1
answer
7k
views
Orthographic projection not showing a triangle
I just want to draw a simple triangle using GL_LINES primitive with orthographic projection matrix.
This is my vertices...
...
3
votes
1
answer
705
views
Matrix math in cascade shadow mapping
I am implementing cascade shadow mapping algorithm and currently stuck with matrix transformations - my AABBs, when projected in light space are pointing in the direction opposite to the light:
I was ...
0
votes
1
answer
2k
views
Get world object transform relative to another object (potential parent)
I'm attempting to parent a bullethole decal to a dynamic object. I've figured out how to set the correct position for the bullethole object so that it shows at the correct position of the dynamic ...
0
votes
1
answer
3k
views
convert world to screen coordinates with camera position and camera angle
Heyho :)
I'm trying to convert world coordinates to screen coordinates. I have available: fov, screen width, screen height, camera position, camera angle and obviously the position of the object in ...
3
votes
1
answer
2k
views
Euler angle and Quaternion conversion become weird when yaw is bigger than 90 degrees
I'm writing a camera which needs to change a quaternion to Euler angles than change them back, it only works when the yaw is less than 90 degrees, I wrote a example to check:
...
1
vote
0
answers
135
views
Subtract a circle on a rectangle - OpenGL
I am writing a game using GLFW, GLEW, GLM and Bullet3 in C++. Its a Maze with holes. I am doing the floor with rectangles (wich is 2 GL_TRIANGLES).
I want to make some woles (circles), to the ball ...
2
votes
1
answer
527
views
ASSIMP Skinning seems to be somewhat inverted
I'm currently implementing Skinning using Assimp as my asset importer. I've relied heavily on the following tutorial in order to skin meshes (http://ogldev.atspace.co.uk/www/tutorial38/tutorial38.html)...
2
votes
1
answer
3k
views
GLM conversion from euler angles to quaternion and back does not hold
I am trying to convert the orientation of an OpenVR controller that I have stored as a glm::vec3 of Euler angles into a ...
1
vote
1
answer
487
views
Opengl Airplane Camera
I am making a game in opengl and am trying to get a camera to follow an airplane. How can I get the camera to match the roll, pitch, and yaw of the plane? I am using glm as my math library. Thanks!
0
votes
2
answers
859
views
Problem Implementing SAT Collision in 3D, OBB vs OBB
I am trying to implement SAT collision detection between 2 OBBs, however, I am getting a lot of false positives, can anyone help me figure out what I am doing wrong, thank you in advance.
This is my ...
1
vote
1
answer
3k
views
how to use glm::rotate with a eulerangle?
I have a vec3 to represent my object's orientation/rotation but the glm::rotate method expects a quaternion. If I just convert ...
0
votes
0
answers
72
views
GLM: Camera attached to model moves in opposite direction from the model
I have been working on a component based engine with nested game objects each with there own transformation's. Each game object calculates its position in the world based on its parents world ...
1
vote
0
answers
140
views
Get world position from Fragment Depth
I am trying to write the depth value in a G-buffer pass and then read it later to determine the world-space location of a fragment.
I have this shader which renders my G-buffer pass
...