Advertisement

Latest matrix Activity

A major part of gameplay is making sure objects are at the right places at the right times. This means you must understand the mechanisms behind how objects in a scene are placed at a particular position. You need to know how to do stuff like program a door to swing open when activated, or calculat…

2,342 views
Advertisement

snoken said:
When using quaternions, the skeleton looks fine except the z axis rotation. The arms go up instead of down. If I negate only Z, the arms come down as they should but they are not aligned with the torso, they are rotated back. Other than that, the skeleton looks fine and in the correct p…

5,818 views
How to adjust a projection matrix to product the same size render, but on a smaller texture?

Perhaps you should try using a scissor rectangle for this. With this method you would set scissor rectangle to the full backbuffer and render the normal scene, then set the scissor rectangle to the “magic window” portion of the backbuffer and render the “magic view”.

3,918 views
DirectX9 projection problem

Hello, I have a problem in DX9: I am projecting objects with the LightProj matrix. 
 

View and projection


The problem is that my objects will be projected from (-infinity to +infinity). 
At the end, I'm setting the object projection texture SetTexture(projection) with
 SetTransform(m…

3,177 views
Skeletal animation - Rotations seem to be inverted

@joej So.. scrolling through my geometry loader I found an innocent looking line of code I had forgotten about. 

finalVertex.z *= -1;

POOF everything is now working fine ?

Will go cry for a bit, I'll be fine.

4,141 views

Hi everyone, how are you doing?

I am working an a Tri-Planar Map shader and it uses the object space world position to create uv maps.

I ran into a little issue that if I scale the object to be larger the tiling of the texture is effected.

Is there any way to scale the position according to the size o…

2,448 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,577 views

I use these two, but different convention from DirectXMath, so you need to do some work on the matrices.

Those are methods of a 3x3 matrix class, and so you have to swap the rows with columns on code like this: (*this)[a1][a2] → (*this)[a2][a1]

After that the code should work even if you use 4x4 matr…

5,078 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,774 views

Why with a cam->vec (0, 1, 0) or (0, -1, 0), a rotation on the yaw axis is actually made on the roll axis ? 
Is it the gimbal lock? It is present only for these two axes? How to fix this problem?

7,478 views

The way I find up_tmp in init_camera_axis() is not optimal because if my cam->vec is (1, 1, -1) I can't find the right up_tmp. I currently find (0, 0, 1) and it should be equal to (-1, 0, 1). Do you have any idea how I can correct this ?

8,255 views

I had to normalize right and up.

41,717 views

Thank you very much for your help. 
Finally, this helped me :
https://gamedev.stackexchange.com/questions/185245/rotating-camera-in-3d-without-yawing-diagonally

I still have to calculate the angles and manage the interval.

8,138 views
Parent transforming issue (OpenGL & GLM)

Did not read it all, but looks your problem comes from nonuniform scale, which leads to skewed, non ortho normal child frames if not treated individually.

I don't know how Unity handles this, but most 3D modeling software does not propagate skewed matrices down to the children. Instead they propagat…

7,670 views

Column-major format is standard in the numeric community, probably because Fortran picked that format.

It is just that C++ uses row-major, perhaps because the numeric community indexes a matrix as (row, column), and c++ matrix[row][col] notation then makes it row-major.

9,646 views

Thank you

I guess that optimal data locality implies that accessing consecutive memory locations is faster than address each matrix row at a different location with the pointer (is this really slow ?), even if with your solution you have the overhead due the index computation (column + row * num_co…

4,139 views
Advertisement
Advertisement