🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
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…
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…
Hello, I have a problem in DX9: I am projecting objects with the LightProj
matrix.
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…
@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.
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…
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…
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…
well done, that looks better ?
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…
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?
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 ?
I had to normalize right and up.
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.
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…
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.
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…