Questions tagged [glm-math]

GLM is a C++ math library designed to mimic the OpenGL Shading Language's math functions and types (vectors, matrices) as closely as possible.

GLM is a C++ math library designed to mimic the OpenGL Shading Language's math functions and types (vectors, matrices) as closely as possible.

OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications.

Do not confuse the tags and (Generalized linear models)

1335 questions
-2
votes
1 answer

Normal Mapping Issues

I'm attempting to implement normal mapping into my glsl shaders for the first time. I've written an ObjLoader that calculates the Tangents and Bitangents - I then pass the relevant information to my shaders (I'll show code in a bit). However, when I…
aromans
  • 53
  • 9
-2
votes
1 answer

I'm trying to make a snake with opengl but some vertices seem to go off, what can I do?

I've been trying to make a Snake in c++ with Opengl, the main components work and quite everything is fine, but somehow when the Snake's tail gets bigger, it glitches. Program's exact behaviour: Basically, I already "made" this but without batch…
Taka
  • 11
  • 3
-2
votes
1 answer

opengl camera on aeroplane shows shaking world when aeroplane is rotated along yaw or pitch or roll

i have implemented aeroplane movement in opengl but when i kept camera on aeroplane head and looking at yawaxis its giving shaking world eye = glm::vec3( ball1.position.x + 25.0f * ball1.roll_axis.x+ball1.yaw_axis.x, ball1.position.y + 25.0f…
daya
  • 9
  • 3
-2
votes
1 answer

Sphere mesh in modern OpenGL

I'm trying to create a triangle mesh of a sphere surface and draw it with OpenGL 4.1. This is the code that I'm currently using obtained from the second answer of that question, The vertex layout is [x, y, z, r, b, g, a] that's why there is 7 float…
Noè Murr
  • 496
  • 4
  • 11
-2
votes
1 answer

Performance reduce when draw more object with OpenGL

I'm trying to code an FPS with OpenGL and C++, and the first object (a cube with texture) is normal when I move the viewpoint, but when I try to draw a static crosshair, the program start to lag. Here is the main loop pseudo code: while (running) { …
Bh Bb
  • 33
  • 1
  • 4
-2
votes
1 answer

glUniformLocation returns -1

I'm trying to uniform a model matrix into a vertex shader using glUniformMatrix4fv(glGetAttribLocation(shaderProgram, "modelMatrix"), 1, GL_FALSE, glm::value_ptr(objmesh[0]->modelMatrix)); but when I use this, the model does not show. I've used…
Haplue
  • 70
  • 9
-2
votes
1 answer

OpenGL triangle not rendering

I've written some OpenGL code in c++ to render a red triangle to the screen. The program uses opengl 3.3 and glsl version 330. I've narrowed down the code that doesn't work to a few .cpp class files or my glsl code. I get no compiler or linker…
Matty2532
  • 50
  • 10
-2
votes
1 answer

C++/OpenGL glm Can't plug matrix into uniform in shader

I can't use my matrix in my OpenGL shader; this is giving me an error: glUniform4f(matLocation, mat[0], mat[1], mat[2], mat[3]); // glm mat4 no suitable conversion function from "glm::tvec4" to "GLfloat" exists I don't entirely…
Accumulator
  • 873
  • 1
  • 13
  • 34
-2
votes
1 answer

I have difficulty in normalise my vector by using open gl

I am trying to normalise the vector by calling glm::vec3(x,y,z) = glm::normalize(glm::vec3(x,y,z)) but when I print the new x,y,z they seems not correct since some values bigger than 1
Fiona H
  • 1
  • 1
-3
votes
2 answers

Is there a way to rotate multiple model matrices on one pivot point in world space?

I am using OpenGL with GLFW and I am trying to rotate multiple objects, each with their respective model matrices on the same pivot point. I have three different models for my rabbit, one body, one front legs, and one back legs, and I am trying to…
instance
  • 7
  • 8
-3
votes
1 answer

Ball to fixed ball collision

I am trying to implement balls that change their direction when they hit an obstacle(in this case a fixed ball). I can detect when a collision occurs but I don't know how to modify the direction of a ball once it hits an obstacle. Here's some…
-3
votes
1 answer

Glm or self implementation

I have been learning opengl lately, and I am following two tutorials. One of them is http://www.opengl-tutorial.org and the other one is http://ogldev.atspace.co.uk . The first one is relatively simpler, and uses external libraries such as glm (…
Ozum Safa
  • 1,458
  • 2
  • 15
  • 27
-4
votes
1 answer

Simply generating a cubemap leads to a black screen

Here is a a minimal example causing GL to render a black screen: // ... all the usual GL init code etc. & GLAM includes const int SHADOW_SIZE = 1024; const int SWIDTH = 1200, SHEIGHT = 900; unsigned int shadowMap, albedoSpec; // Begin snip…
user3482098
-4
votes
1 answer

Damped camera using GLM?

I have read about the damping. Basically it is smooth camera movement. However, I am not sure how to implement damping using C++, OpenGL, and GLM. Help me with a small sample code.
Javier Ramírez
  • 1,001
  • 2
  • 12
  • 23
-4
votes
1 answer

C++ cannot find cmath

When I try to build a C project in code:blocks on ubuntu 14.04 that uses GLM I get this fatal error: cmath: No such file or directory Any ideas how to fix this?
1 2 3
88
89