#### Category : glm

I have a struct which I am passing as an argument. The idea is to take create a quaternion via slerp function by comparing the quaternion of a camera object and some other target &t orientation. The problem is probably that I do not understand the math. The camera currently operates on euler angles (I ..

I have been following this tutorial creating 2d games with opengl. I have a problem creating an orthogonal projection matrix. I used glm::ortho() as stated in the tutorial. But I have this problem no suitable user-defined conversion from "glm::detail::tmat4x4glm::lowp_float" to "glm::mat4" exists. How can I fix this problem? glm::mat4 projection = glm::ortho(0.0f, static_cast<float>(this->Width), static_cast<float>(this->Height), 0.0f, ..

I’m calculating tangents & normals per-vertex and it works perfectly when the mesh’s position is set to (0, 0, 0), but when I try to add to the position and recalculate the tangents/normals the object gets deformed in a weird way. this is the mesh when its position is set to (0, 0, 0) which ..

I’m trying to create a Sphere to AABB collision detection method using GLM, where the AABB model is rotated 25 degrees on the x-axis. I’ve modified the collision detection found near the bottom of https://learnopengl.com/In-Practice/2D-Game/Collisions/Collision-detection in order to attempt to take in an offset value as the AABB center to account for the rotation however ..

I set up my ortho projection like this : transform = glm::ortho(0.0f, width, height, 0.0f); this works pretty well, but when I want to use the glm::rotate function like this: transform = glm::rotate(transform, glm::radians(45.0f), glm::vec3(0, 0, 1)); my object rotates around 0 : 0 : 0. my vertices look like this: GLfloat vertices[] = { ..

In my project I use a fairly complex camera glass which doues trackball / arcball rotation arround the center. That works fine sofar. For the creation of the MVP matrix I use: // Get a handle for our "MVP" uniform GLuint MatrixID = glGetUniformLocation(shaderProgram, "MVP"); // Projection matrix : 45° Field of View, 4:3 ratio, ..

I have a struct: struct ColorspaceData { private: glm::vec3 sMatrix; constexpr void init(float c_xr, float c_yr, float c_xg, float c_yg, float c_xb, float c_yb, StdIlluminant c_whitepoint, TransformData c_linearTransformData) { xr = c_xr / c_yr; xg = c_xg / c_yg; xb = c_xb / c_yb; yr = 1.0f; yg = 1.0f; yb = 1.0f; zr = .. I have coded a flat terrain made up of triangles, but it seems like there some mirroring occurs. I want it to imitate grass, but it is blurried in some spots. Do I need to add some params in glTexParameteri? Or maybe it is an error which is associated with the drawing code? A function ..