Category : glm

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, ..

Read more

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 ..

Read more

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[] = { ..

Read more

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, ..

Read more