Questions tagged [glm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
41 views

How to rotate an object in OpenGL on the X, Y and Z axis on its local coordinates?

I've read multiple tutorials, but I still can't understand how do I properly rotate an object in 3D space on all 3 axis at once. For example, I'd like to give the object a pitch of 60 degrees, yaw of ...
-1
votes
1answer
61 views

Difficulty including GLM into Visual Studio with OpenGL

I have been trying to implement GLM (math library) into Visual Studio with OpenGL. I have followed and watched many online resources that point me to include only the GLM folder inside the ...
1
vote
0answers
418 views

360 degrees rotation around x axis

How do we rotate the camera around x axis 360 degrees, without having to flip the axis, meaning without having the strange flip after we go over +-90 degrees on <...
1
vote
1answer
173 views

My (ADS) shader doesn't render the light direction correctly

This is what I'm doing: vertex shader: ...
1
vote
1answer
307 views

Am I passing the correct matrices for my shader? openGL/C++

On page 89 of David Wolff - OpenGL 4.0 Shading Language Cookbook book, it suggests a way to set up up a Phong shader in the fragment stage. It lists some different matrices to pass via uniform, and I ...
2
votes
0answers
126 views

With OpenGL, is it correct to apply model transformation to rotate the camera?

Having taken a basic CG course, I remember that transformations are relative, so rotating the camera is identical to rotating the view in the opposite direction. Right now I want to implement camera ...
3
votes
1answer
3k views

understanding glm::perspective vs glm::ortho

I'm new to computer graphics. I played around with OpenGL and now am trying out Vulkan. Basically what I want to do, in 2D is have an 800x800 window, and I want that to represent 800 meters by 800 ...
9
votes
3answers
5k views

Multiple viewports with modern OpenGL?

I use SDL2. Currently my only shader has a MVP matrix, and transforms the points with it. I calculate my View and Projection matrix for a camera with GLM: ...
3
votes
1answer
2k views

Screen to World coordinates glm::unProject

I'm having some trouble trying to figure out how to go from a coordinate on the screen, to 3D world coordinates on a plane. My case is as seen on the picture further down. World origin is in the ...
3
votes
1answer
434 views

Ray-tracing the Cornell Box results in really inconsistent image

So I have a vector of glm::vec3 containing the triangles for the classic Cornell Box called triangles. The Draw method casts a ray for each pixel on the screen and ...
14
votes
1answer
7k views

Get vector length with GLM

I am quite confused over how GLM library is behaving or I am using it improperly. glm::vec2 testVec(6,-4); float len = testVec.length(); I get the value ...