Advertisement

Latest glm Activity

Calculating Normals of a Cube

Thank you for the hint. I visualized the normal vectors and saw that they all had seemingly random orientations:

I printed out the calculated normals and visualized them by hand, confirming that they are actually all correct. I then changed my focus to the matter of actually sending this data to the…

3,319 views
Advertisement
Pre-Calculating Lightmaps using the depth buffer for shadowing

@Vilem Otte Thanks for your suggestions.  I use the same approach like calculating a shadow map. I use the depth buffer to check if certain lumels are visible from the light sources and if they are, I color them accordingly. For the depth buffer - I use the default depth buffer. If I'm not mis…

4,306 views

It's not possible to prevent flipping if you construct a tangent for given normal, but if your tangent is free, you can minimize it's change over time with a changing normal. To do this, you need to store the tangent (or the whole matrix), and keep rotating it each frame so one chosen axis matches …

5,866 views
Finding world position of element in screen space

Looks like the issue was that I was including the projection matrix in `invMat`. Removing it has resolved the issue. Below is what I wound up with:

glm::mat4 invMat = glm::inverse(worldStage.getCamera().value().getViewMatrix());
glm::vec4 tmp = (this->weapons[this->currentWeapon].actor->get…
4,581 views

I am making a 3D space shooter game using OpenGL and Bullet Physics. I am having a hard time with the 3rd person Camera though. If you take a look at the video above you can see that the camera follows the spaceship rotating on the X axis without a problem and rotating on Z axis also without a prob…

4,758 views

How to create a (center & extent/radius) AABB of an AABB rotated a quaternion?

I'm currently using the code below, from the Real-Time Collision Detection book, which seems to work correctly but use a 3x3 matrix. Is there a way to avoid the matrix conversion and rotate the AABB directly using the…

3,883 views

@cebugdev2 Btw I was having a similar problem again (I haven't used matrices much recently) so you got me at the right time.  Note I am using a row based matrix. Whenever you are dealing with a matrix in an array you should always go from left to right top to bottom. So this is what you are do…

5,973 views

babaliaris said:
What happens when the forward direction f becomes parallel with the up vector (Looking at the scene from top-down)?

The functions fails on division by zero.

Discussed this recently here: https://www.gamedev.net/forums/topic/707867-lookat-how-to-get-the-correct-temporary-vector-up/

The…

5,777 views

Hi, I'm working on blending skeletal animations in my project. And I finally got confused in my own code...

I have 2 arrays of glm::mat4, which represents lhs and rhs animation's bones. So, I need to blend these 2 arrays of bones in the third one.

In the very beginning I wrote next naive approach:

inl…
3,755 views

@JoeJ I'm aware that Quaternions aren't required for cameras, but they tend to be used quite often because they can be less memory intensive.

Currently at work, but I'll take a look at your method when I get home! Thanks!

7,458 views
Advertisement
Advertisement