Posted: Sat Jun 22, 2024 1:50 am Post subject: Where is my math wrong?
I'm trying to change the values of a rotation matrix. I can change yaw and roll just fine but if I change the pitch things glitch out, so there must be some mistake in how I'm calculating or editing pitch specifically.
I believe that the matrix functions exactly like this one (sorry, can't post URLs yet): eecs.qmul.ac.uk/~gslabaugh/publications/euler.pdf . I extract the yaw, pitch and roll in radians, convert them to degrees, change the degrees by key input, convert them back into radians and feed those values back into the matrix.
My function to do this looks like this:
Code:
local M11 = "[pCamCoords]+24"
local M21 = "[pCamCoords]+28"
local M31 = "[pCamCoords]+2C"
local M12 = "[pCamCoords]+30"
local M22 = "[pCamCoords]+34"
local M32 = "[pCamCoords]+38"
local M13 = "[pCamCoords]+3C"
local M23 = "[pCamCoords]+40"
local M33 = "[pCamCoords]+44"
If I change pitchDeg/RadNew, yawDeg/RadNew and pitchDeg/RadNew also get changed even though they shouldn't. Changing yawDeg/RadNew and rollDeg/RadNew does not change either of the other values and simply changes yaw/pitch as it should.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum