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

#### Category : glm

I tried translating a glm::mat3x2 using the glm::translate(matrix, vector) from glm/gtx/transform.hpp but I got an error no matching function for call to ‘translate(glm::mat3x2, glm::vec2)’ Source: Windows Que..

When I am making changes to my code, the external files are compiled multiple times. I am using math library glm, and Visual Studio seem to be compiling exactly same glm/vec3.hpp file multiple times. I have included glm header multiple time, and it seems that it doesn’t use previously compiled code, but recompiles it again. ..

I create a cube like normal using 8 vertex points that outline a cube and use indices to draw each individual triangle. However, when I create my camera matrix and rotate it using the lookat function with glm it rotates the entire screen positions not world positions. glm::mat4 Projection = glm::mat4(1); Projection = glm::perspective(glm::radians(60.0f), (float)window_width ..

I would like to check if glm uses SIMD on my machine or not. CPU: 4th gen i5, OS: ArchLinux(up to date), IDE: QtCreator. I wrote a little application to test it: #include <iostream> #include <chrono> //#define GLM_FORCE_SSE2 //#define GLM_FORCE_ALIGNED #include <glm/glm.hpp> #include <xmmintrin.h> float glm_dot(const glm::vec4& v1, const glm::vec4& v2) { auto start = ..

I want to create a rubiks cube where each side contains multiple cubes. So far I’m able to create the overall Cube. I now want to rotate one side of the cube to the left, to do this i create a new matrix and then bind the uniform to that matrix. This works fine, but ..

I have the following code: void mouseCallback(GLFWwindow* window, double xpos, double ypos) { if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS) { const float radius = std::sqrt(std::pow(camX, 2) + std::pow(camY, 2) + std::pow(camZ, 2)); camX = (cos(ypos) + sin(ypos)) * radius; camY = (sin(xpos) + cos(ypos)) * radius; camZ = (cos(ypos) + sin(xpos)) * radius; } } this ..

I tried having a for loop which added these spesific vertices however it would not link themselves to eachother resulting in individual trangle strip. These are my current set verticies: GLfloat vertices[] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, //bottoms left 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, // top left 1.0f, 0.5f, 1.0f, 1.0f, 1.0f, //bottom ..

I ‘ve got hierarchy of the bones. Each bone might has parent and children. Each bone has it’s local model matrix and world model matrix. I want to translate bone to the position of the mouse. I am using glm library. This is how I did it: // boneWorldOrigin is the position of the bone ..

I’m using my Macbook with Xcode and OpenGL (coding using C++) to learn how to add cameras to a graphic. Here I want to add a camera behind an object as a third-person view camera, and then use the ‘WASD’ buttons to move the object and use the mouse cursor to change the object’s direction ..

## Recent Comments