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

learn more… | top users | synonyms

0
votes
0answers
25 views

Batch geometries

I would like to batch my meshes but I'm not sure how to do it. For the moment, I merge all meshes with the same format and same material in a single mesh. Everything work, but transformation is not ...
1
vote
2answers
79 views

Weird GLM perspective problems with my 2D Game

I am trying to create the graphics system of a 2D game using OpenGL 3.3. To help me in this task I am using the GLM math libraries. However I am having some trouble. When my objects (for now they ...
3
votes
1answer
126 views

glm direction vector rotation

I'm working on a flight simulator, but I'm stuck with my airplane orientation. I tried some things but noone worked correctly. This is what I have : To be able to move it and roll it around himself, ...
1
vote
1answer
58 views

Compute billboard rotation

I'm trying to compute a matrix to have object always facing the camera. For the moment, my result look pretty good, the problem is that my original billboard scale isn't preserved (Every billboard ...
4
votes
1answer
150 views

How to calculate directional light frustum from camera frustum

I'm playing around with OpenGL for a few weeks now. For the following screenshot I picked the glm::ortho values for my lightsource by trial and error. There are two directional light sources with ...
3
votes
2answers
146 views

GLM/OpenGL: How Can I Prevent Vector Magnitude From Increasing While Rotating Bones in Skeletal Rig?

ANSWER AT THE BOTTOM OF THIS QUESTION I have been reading tutorials, articles, questions on StackExchange and books all with the subject of skeletal rigging. I have boiled my program down to just the ...
1
vote
0answers
80 views

OpenGL/GLM Camera

I want to make a camera that can freely look and walk on X/Z plane and rotate 360 degrees. I'm using OpenGL and the lookAt function from the GLM library to create the view matrix. I've looked through ...
2
votes
1answer
224 views

OpenGL - have object follow mouse

I want to have an object follow around my mouse on the screen in OpenGL. (I am also using GLEW, GLFW, and GLM). The best idea I've come up with is: Get the coordinates within the window with ...
0
votes
1answer
105 views

Making particles accelerate toward a mouse point

I'm currently working on a particle simulation program that makes pixels move towards a mouse point continually accelerating, but i'm running into some math issues. Currently my particle will ...
0
votes
0answers
65 views

Bounding box center after transformation - want degree values for GUI

Similar to my previous question, I have a bounding box that I have transformed and scaled. Now, I want to get its center by doing this operation and store this value. bbCenter = glm::vec3(bbMin_x + ...
0
votes
0answers
72 views

GLM Rotating Combining Multiple Quaternions?

I have a camera which I want to control with my mouse. I want the mouse to control the pitch and yaw of the camera but not the roll. To avoid loss of significance, I am storing the quaternions for ...
1
vote
1answer
297 views

How Extract Frustum Planes from Clip Coordinates?

I'm having some problems with my Frustum Culling and I want to debug it, so I'm trying to render it's planes, to see exatly the Frustum. But I'm using the Clip Coordinates to do the culling (like ...
0
votes
1answer
165 views

Build unity like Transform class [closed]

I am building a Unity-like Transform class. This is my header file: #include "Common.h" struct Transform { public: Transform(); void Translate(float x, float y, float z); ...
2
votes
1answer
797 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
688 views

problem using glm::lookAt and glm::perspective

I'm trying to change the code from the 22th tutorial at http://ogldev.atspace.co.uk/, using the GLM library, but the result seems wrong. The problem is shown in the below picture: While it should be: ...
1
vote
1answer
1k views

glm quaternion camera rotating on wrong axis

I'm trying to get my camera implemented with a glm::quat used to store the rotation. However, whenever I do circles with the mouse, the camera rotates along the axis I am viewing (i.e. I think it's ...
4
votes
1answer
320 views

Why do these quaterion multiplications produce different results?

I am trying to use quaterions to modify the camera direction vector. This code works perfectly: glm::quat temp1 = glm::normalize( glm::quat((GLfloat)( -Input1.MouseMove.x * mouse_sens * time_step), ...
2
votes
1answer
2k views

Combining rotation,scaling around a pivot with translation into a matrix

In short: I need to combine rotation (in the form of a quaternion), scaling around a pivot point along with translation into a transformation matrix. The long: I am trying to implement a proprietary ...
1
vote
0answers
95 views

Determining axis to rotate around

I'm trying to implement a free-look third person camera (using glm). I know that the general transformation is newCameraPosition = translate(lookatPoint) * rotation(angle,axis) * ...
1
vote
2answers
176 views

What ways are there for making vector types available in scripting?

I use Google V8 engine to embed Javascript into my game for scripting. As interface to my native code, I already registered some C++ functions to the scripting context. In the native code, I make ...
0
votes
0answers
244 views

Space Strategy Ship Movement Math

This is similar to a question I asked a while ago, but I phrased it so terribly so might as well start over. I am trying to implement ship movement in 3D space, but confined to a 2D plane at y=0 (see ...
3
votes
2answers
3k views

Rotating an object when the center in not the origin - opengl

I'm beginning with GLSL and I learning the basic, I am using glm to do the matrix calculations at this point everthing ok,the problem is how I can move the origin to the center of my object, not the ...
0
votes
1answer
192 views

Trying to convert as3 Matrix to C++ glm matrix

I am trying to convert a library called DragonBones to C++ Opengl which allows you to use Flash based skeletal animation. I'm almost done but I am running into a problem. I am trying to transform the ...
0
votes
1answer
392 views

How can I remove the view and projection matrix from ray position to get only the ray model?

I've got a little problem with my picking module and I need your help. I have a method to project a ray from the camera to a fixed point when I click somewhere. The computed ray looks good, it go to ...
1
vote
1answer
83 views

Get the address of a matrix in GLM library

Is there a way to get the address of a matrix from a GLM matrix? I'm using opengl 4 and glm library though I can't seem to find anything, which might help.
2
votes
1answer
187 views

How to rotate camera around some point?

I have screen with dimensions: 800x600. The object that I want to rotate around is located at (400,300, -50) - center of the screen. Orthogonal projection: Near plan - 0.1f, far plane - 1000.0f left - ...
3
votes
1answer
503 views

Rotating and Translating a Node in Horde3D with Matrices and Quaternions

I have been trying to learn how to use the Horde3D rendering engine for the past couple of days, and so far I have managed to learn a decent amount and integrate Bullet Physics with it as well. My ...
0
votes
2answers
932 views

Texture mapping issue in my Wavefront *.obj parser

I wrote a simple *.obj parser reading read vertices, texcoords and normals. But when I draw a model the texture isn't mapped correctly. I have already tried uv.y = 1.0f - uv.y to get inverted Y axis ...
4
votes
1answer
774 views

Picking 3D with OpenGL ES 2

I'm trying to implement picking in my framework but I don't understand how I can do this. I'm working with: OpenGL ES 2. GLM mathematic library. What I have understand, picking can be made with ...
0
votes
1answer
355 views

gluLookAt strange behavior implementing camera

I'm having a super tough time trying to implement what I thought would be a very straightforward problem. I'm trying to demonstrate a free camera that can move forward/back, strafe left/right, fly ...
-1
votes
1answer
196 views

Transformations are not correct using GLM and OpenGL

The aim of my program is to render a simple colored triangle in rotation. The rotations are correct if all Z values of my vertices are equals to 0.0f. If one of these values are different of 0.0f the ...
-2
votes
1answer
247 views

Incorrect rotations using openGL GLM and shaders [closed]

The goal of my program is to display a simple colored triangle rotating on the Y axis without any translation. I'm using the GLM library. The problem is that the transformations of my triangle are not ...
2
votes
1answer
2k views

How to implement a basic arcball camera in OpenGL with GLM

I only just started learning OpenGL and even things like vector maths etc a couple of days ago, so I am having a bit of trouble figuring out exactly what to do to implement an arcball camera system. ...
0
votes
1answer
218 views

Box2D OpenGL debug renderer convert box2d coordinates to world space

I made an OpenGL 3.x renderer for Box2D's debug draw (b2Draw base class). Unfortunately I've tried for a while now to convert the box2D units, which are meters to my internal units which are pixels. I ...
0
votes
2answers
428 views

Translate camera position toward camera orientation

I have a camera position (Vec3) and camera horizontal/vertical angle. Now I want to translate my camera position toward the current camera orientation - what is the best way to do that? I am sure it's ...
2
votes
1answer
1k views

Android ndk-build can't find glm headers

I am trying to port some boilerplate code of mine to work on android, using the android ndk & NativeActivity So far I have just one file that defines the glue between android and my code and it ...
1
vote
2answers
679 views

Matrix Rotation with three Angles

I want to rotate a form with three given angles fo each of the three axis. But the GLM rotation function takes only one angle and a vector as arguments. How can I convert between both formats?
3
votes
2answers
8k views

Camera rotation - First Person Camera using GLM

I've just switched from deprecated opengl functions to using shaders and GLM math library and i'm having a few problems setting up my camera rotations (first person camera). I'll show what i've got ...
1
vote
1answer
2k views

matrix 4x4 position data

I understand that a 4x4 matrix holds rotation and position data. The rotation data is held in the 3x3 sub-matrix at the top left of the matrix. The position data is held in the last column of the ...
0
votes
1answer
378 views

vector rotations for branches of a 3d tree

I'm attempting to create a 3d tree procedurally. I'm hoping that someone can check my vector rotation maths, as I'm a bit confused. I'm using an l-system (a recursive algorithm for generating ...
1
vote
2answers
3k 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 ...
4
votes
4answers
6k 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 Eular Angles and I need to perform smooth interpolation between them. The best way is converting them ...