Questions tagged [glm]

GLM is a C++ math library based on the GLSL language.

Filter by
Sorted by
Tagged with
0
votes
2answers
32 views

Rotating an object to face the same direction as another object

Feel like I should know this, maybe I'm just over thinking it. What I'm attempting to do is create a bullet hole plane/texture object on top of an existing mesh when a ray cast returns a hit point. I ...
0
votes
0answers
35 views

How do I make the 3rd person camera follow the space ship in my Space Shooter game?

https://youtu.be/13HgaeZWlIA I am making a 3D space shooter game using OpenGL and Bullet Physics. I am having a hard time with the 3rd person Camera though. If you take a look at the video above you ...
0
votes
1answer
387 views

Swept aabb 3d incorrect collision resolution along negative normals

I have followed this tutorial and ported it to 3d with glm. Everything works fine when the collision normal is reported as positive ((1,0,0),(0,1,0),(0,0,1)) but when it is negative the player aabb ...
0
votes
1answer
133 views

How do I calculate the bounding box for an ortho matrix for Cascaded shadow mapping?

I've been trying to get a cascaded shadow mapping system implemented on my engine, though it appears to be that the bounding boxes for the cascades aren't correct. The part I'm interested in can be ...
0
votes
0answers
21 views

When using transformation matrices, how does one convert orientation and scaling from a global frame of reference into a local one?

Note: I'm certain I cannot be the first to answer this question. Unfortunately, the answers I need are buried under an avalanche of posts asking how to move coordinates between frames of reference, ...
1
vote
1answer
181 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: ...
0
votes
0answers
35 views

C++ OpenGL Arcball controlls 'flipping direction' after crossing any of the axes

hello graphics developer... I want to implement something like the mouse rotation controls found in 3D modelling software like MeshLab Here is the code in the mouse callback: ...
0
votes
0answers
24 views

Align object according to camera rotation so it stays fixed

I'm trying to implements a bullet whose orientation aligns with the free movement of my first person camera. I got the following camera code from learnopengl.com: ...
1
vote
0answers
38 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 ...
3
votes
2answers
11k views

Direction vector to quaternion

I have a unit vector (direction) which represent a rotation around Y axis, and would like to turn this into a quaternion to represent the same rotation. I use GLM library, but interested any library ...
0
votes
1answer
72 views

Simplifying Camera Strafing

I have a camera that follows the position and direction of the player. These are updated using spin and velocity. The velocity is updated like so: ...
1
vote
1answer
119 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)...
0
votes
0answers
140 views

OpenGL viewport is stretched

For this project I am using GLFW, glad and glm. My window looks like this: The dimensions of the window are correct, but the viewport is stretched, making my square into a rectangle. How do I use a ...
1
vote
1answer
566 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
1answer
232 views

Storing transformations in game objects. (GLM, C++)

I'm currently writing a game engine from scratch for learning purposes. I just started implementing transformations. I know how they work in general but I'm not sure how to implement them efficiently ...
1
vote
1answer
137 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!
1
vote
1answer
63 views

Find angle (slope) of collision plane?

I have implemented a collision and response system based on the famous "Improved Collision detection and Response" paper. However I'm having an issue with objects sliding backwards on slopes. I ...
0
votes
2answers
266 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 ...
14
votes
4answers
26k views

GLM: Euler Angles to Quaternion

I hope you know GL Mathematics (GLM) because I've got a problem, I can not break: I have a set of Euler Angles and I need to perform smooth interpolation between them. The best way is converting them ...
1
vote
2answers
6k views

GLM: Quaternion SLERP Interpolation

I wish to interpolate two quaternion values. As I still can not get working results, can I kindly ask you to verify my function calls? The code below supports GLM (OpenGL Mathemathics) library, so ...
1
vote
0answers
50 views

Matrix for transforming a square to a quadrilateral

I have a square of points {<0, 0, 0>, <6, 0, 0>, <6,0, 6>, <0,0,6>} (The square is placed at the origin in the xz plane in opengl). Want to apply a transformation/s on the square and make ...
3
votes
2answers
2k views

Quaternion based camera pitch freaking out, and Z-axis drift

This is the code I use to control my (first person) camera's movement and rotation. Translation successfully keeps orientation in mind, so that up and left and such are always in the expected ...
1
vote
2answers
3k views

How to use GLM Simd using GLM version 0.9.8.2?

I am new user for GLM, can somebody guide me how to use GLM SIMD using its version 0.9.8.2. According to its Manual using #define GLM_FORCE_SSE2 For example, if I write: ...
3
votes
3answers
14k views

Convert a direction vector (normalized) to rotation?

Say i have something like this: pos += glm::normalize(target - pos) //PLEASE NOTE: pos is a glm::vec3 and so is target This makes "pos" translate towards "target"...
4
votes
2answers
18k views

Rotating an object with quaternion

I have a question in regards to using quaternions for the rotation of my graphics object. I have a Transform class which has the following constructor with default ...
1
vote
1answer
998 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
1answer
1k views

GLFW - Camera rotation system

I need to make a camera rotation system similar to the one here http://madebyevan.com/webgl-path-tracing/ To rotate, press the Left mouse button and drag. So far I figured a basic idea of how this ...
0
votes
0answers
49 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 ...
0
votes
1answer
1k views

Camera Pitch, Yaw from View Matrix

I have a camera that works with Pitch and Yaw (no roll) and compute the look at matrix as following : ...
0
votes
1answer
8k views

Creating a movable camera using glm::lookAt()

I came across this tutorial on how to create a movable camera in OpenGL using glm::lookAt(glm::vec3 position, glm::vec3 target, glm::vec3 up). In the tutorial, in ...
1
vote
0answers
114 views

Get world position from depth buffer

I have a buffer I am rendering gl_FragDepth (remapped to range 0-1) to a color buffer (instead of color) in OpenGL I would like to, in a second pass, read this ...
1
vote
0answers
64 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 ...
2
votes
2answers
7k views

Getting Vector at 90 Degrees from provided vector

I need a function that can take a vector as an input and provide a vector that is at a 90-degree angle to the provided vector. I understand that in 3D there is an infinite amount of vectors that could ...
0
votes
2answers
136 views

Create circular platform out of tiles

I am creating a 3d game. In this game I have a 3d model for a tile which I render in different locations using instancing. I want to create a number of these tiles arranged so as to approximate a ...
3
votes
1answer
617 views

How to 'point' an arrow in the direction that it's going?

I am relatively new to OpenGL and 3D environments and am having trouble creating a rotation matrix that will rotate an arrow model so it 'points' in the direction that it is going. I am using GLM as a ...
0
votes
1answer
2k views

OpenGL calculate circle rotation around a given point

I'm trying to rotate an object around a certain point. If this point is the center of my world space I use the following algorithm: glm::vec3 center is the center ...
5
votes
2answers
3k views

Skeletal animation with Assimp and glm

I'm trying to implement skeletal animation using assimp and glm. Everything seems to work, except for rotations. This is the code I use when packing assimp data into my own engine's format. I THINK ...
0
votes
1answer
89 views

Restore object right vector to horizontal position using quaternions

I'm fairly new in gamedev mathematics and i have a problem i cannot solve on my own. I'm working on L-System tree generation engine and i'm having serious difficulities while trying to work out ...
0
votes
1answer
233 views

Problem with FPS camera in Software Renderer

I am currently creating a software renderer (I know they aren't particularly useful anymore, it is purely from a knowledge and learning standpoint). I am using GLM and following OpenGL rules(as GLM is ...
0
votes
1answer
178 views

Axis of affine transformation matrix

Let's say I have a right handed column major 4x4 transformation matrix. Can I safely assume (even though there exist non uniform scale) that first column is X axis vector, second column is Y axis ...
-1
votes
1answer
361 views

Get enemy/chaser object to face player object - OpenGL

My chaser object will not face the player object. It simply keeps spinning around and won't face the player. ...
0
votes
1answer
306 views

glm rotating quaternion in Y axis deforms object

I'm implementing my own game engine in C++ and I need help here, I have a game object, its orientation property is a quaternion and I want to rotate it A degrees in the Y axis. So, I have: ...
1
vote
1answer
450 views

Orthographic Projection viewable area

I have a simple orthographic projection that is rotated at an arbitrary angle on any combination of the three axes. I am trying to use these matrices to calculate the viewable area of the screen for ...
1
vote
1answer
371 views

Quaternion Rotation Weird Rotation

I have an fps camera, and i am representing rotation with quaternions. every frame i grab how much the mouse moved that frame and then i simply do ...
1
vote
0answers
65 views

Unwanted continuous rotation with Quaternion

I am probably missing something simple but ... this is how I'm calculating the world matrix of my object: ...
0
votes
1answer
690 views

Camera follow 3D Object OpenGL

I'm trying to make my camera follow a 3D object, the X and Y values from the camera position are the same as the 3D object, but the Z axis is not the same, it has an offset of 13.0f so the camera ...
0
votes
2answers
1k views

Gradually rotate vector towards another vector

For a game I'm making there is an AI bot in it. I want it to rotate so that it is facing it's opponent. The direction it is facing is determined by a vector (it will face the direction that the vector ...
2
votes
1answer
1k views

Rotate an object to face a point with glm::lookAt

I want to rotate an object to face a point, such as the monster look at the player. For that I've decided to use the glm::lookAt function. However the following does not yield good results: ...
1
vote
2answers
739 views

OpenGL object movement is not smooth and vibrating

In my android NDK OpenGL C++ project, I have a render method which executes every frame on draw event so this is the algorithm: ...