Frictional Games Forum (read-only)
matrix and vector math questions - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Open Source Collaboration (https://www.frictionalgames.com/forum/forum-27.html)
+--- Forum: Overture (https://www.frictionalgames.com/forum/forum-29.html)
+--- Thread: matrix and vector math questions (/thread-3430.html)



matrix and vector math questions - nckomodo - 05-25-2010

can anyone point me in the direction of the functions and classes i'd want to use if I were trying to create a particle system at the position of a hud model facing the direction the player is facing?
I'll keep trying and poking around but math was never one of my strong points.


RE: matrix and vector math questions - nckomodo - 05-25-2010

ok, I give, i have absolutely no idea what to do.
closest I can get is having the steam shoot off to the right of the hud model but I cant seem to get it rotated to the proper direction.


RE: matrix and vector math questions - MulleDK19 - 05-25-2010

(05-25-2010, 10:42 AM)nckomodo Wrote: ok, I give, i have absolutely no idea what to do.
closest I can get is having the steam shoot off to the right of the hud model but I cant seem to get it rotated to the proper direction.

Code:
cCamera3D *pCam = mpInit->mpPlayer->GetCamera();
There you have a reference to the camera.


RE: matrix and vector math questions - nckomodo - 05-26-2010

I still can't seem to wrap my head around the matrix math and I'm getting nowhere at an astonishing rate.


RE: matrix and vector math questions - nckomodo - 05-26-2010

Quote:cWorld3D *pWorld = mpInit->mpGame->GetScene()->GetWorld3D();
cParticleSystem3D *pSystem = pWorld->GetParticleSystem("SteamGunEffect");
cCamera3D *pCam = mpInit->mpPlayer->GetCamera();
pSystem->SetMatrix(cMath::MatrixRotate(
cVector3f(pCam->GetPitch(),(pCam->GetYaw()+1.57079633f),pCam->GetRoll()),
eEulerRotationOrder_ZYX));
pSystem->SetPosition(mpEntity->GetWorldPosition());
I've finally got it pointing the right way, almost, if I turn around the pitch seems to invert itself so it points down when I look up.
Any ideas?

I see you.