code logs -> 2021 -> Sun, 05 Sep 2021< code.20210904.log - code.20210906.log >
--- Log opened Sun Sep 05 00:00:16 2021
00:29
<&ToxicFrog>
Argh
00:29
<&ToxicFrog>
Ok, the quaternion [0 1 1 1] should be identity -- it's a 0 rotation.
00:30
<&ToxicFrog>
My understanding is that, to rotate a vector by a quaternion, you do:
00:30
<&ToxicFrog>
V = [0 x y z]
00:30
<&ToxicFrog>
let R be the rotation quat
00:30
<&ToxicFrog>
let R' be its inverse (negated x y z, same theta)
00:30
<&ToxicFrog>
let H be the Hamiltonian product of two quaternions
00:31
<&ToxicFrog>
rotate(V, R) = H(H(R, V), R')
00:31
<&ToxicFrog>
And if R=[0 1 1 1] rotate(V, R) = V
00:33
<&ToxicFrog>
Oh, wait, ok, the vector part of R has to be a unit vector
00:33
<&ToxicFrog>
So that explains *some* of the weirdness I'm seeing
00:34
<&ToxicFrog>
But like
00:35
<&ToxicFrog>
If I have R = [0 0.707 0 0.707] -- that should be a null rotation around a unit vector in the xz plane, right?
00:36
<&ToxicFrog>
But H(H(R, [0 1 0 0]), R') = [0 0 0 1], i.e. my input vector that used to point x-wards is now pointing z-wards
00:39
<&ToxicFrog>
And if R = [0 0 1 0] (i.e. null rotation around the y axis) I get my input vector back out with the X and Z elements negated.
00:43
<&ToxicFrog>
Oh wait shit
00:44
<&ToxicFrog>
the first element is meant to be cos(theta/2)
00:45
<&ToxicFrog>
Ok, so {1,0,0,0} is the identity quaternion
00:47
<&ToxicFrog>
Ok, with this sorted out I think my implementation of qmul and qneg is correct
00:48
<&ToxicFrog>
but that doesn't explain why my planes are still floating into the air ;.;
01:03
<&ToxicFrog>
Aha
01:03
<&ToxicFrog>
Ok, my math is wrong because SupComm quaternions are stored theta last, not theta first
01:08 Degi [Degi@Nightstar-5tv1s1.dyn.telefonica.de] has quit [Operation timed out]
01:12
<&ToxicFrog>
Even correcting for that everything is still wrong though! It's just wrong in different ways. Argh.
01:12 Degi [Degi@Nightstar-fa08bu.dyn.telefonica.de] has joined #code
02:52
<~Vornicus>
Oh, good, you got there
02:52
<~Vornicus>
sort of
02:54
<~Vornicus>
the entire quaternion has to be unit
02:55
<~Vornicus>
it's not just the axis part but the whole thing, the imaginary part is unit axis * sin(theta/2)
04:23
<&ToxicFrog>
I did in fact get all the way there in the end
04:23
<&ToxicFrog>
"quat has to be unit" was only relevant for testing, in the end, because the quats I get back from the engine are always unit
04:23
<&ToxicFrog>
The key insights that got me there in the end were:
04:24
<&ToxicFrog>
- MohoEngine stores quats as [x y z w] rather than [w x y z], so I have to take that into account when implementing vec3<->quat conversions, qneg, and qmul
04:25
<&ToxicFrog>
- if I have a unit rotation R and a vector V and I want to translate that vector from unitspace to worldspace, I need R'*V*R rather than R*V*R', because I need to "unrotate" it via the unit's orientation quat
04:26
<&ToxicFrog>
I still haven't figured out why planes don't bubble when sinking but Oh Well, everything else is working and I've released a new version of `TF_NavalWreckage.scd` for the first time in 14 years
04:28
<~Vornicus>
nice
04:31
<&ToxicFrog>
(changes from 2.0: support added for planes, hovercraft, and naval buildings; sinking units bubble and tumble slowly; code almost completely rewritten to be cleaner and easier to extend)
05:03 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
05:15 Vorntastic [uid293981@Nightstar-phvupn.irccloud.com] has joined #code
05:15 mode/#code [+qo Vorntastic Vorntastic] by ChanServ
06:43 Kindamoody[zZz] is now known as Kindamoody
07:07 catalyst_ [catalyst@Nightstar-ejd4sd.cable.virginm.net] has joined #code
07:07 catalyst [catalyst@Nightstar-ejd4sd.cable.virginm.net] has quit [Connection closed]
07:38 abudhabi_ [abudhabi@Nightstar-ghfs0l.adsl.tpnet.pl] has joined #code
07:40 abudhabi__ [abudhabi@Nightstar-edpsl2.adsl.tpnet.pl] has quit [Operation timed out]
07:41 abudhabi [abudhabi@Nightstar-edpsl2.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
07:42 abudhabi [abudhabi@Nightstar-ghfs0l.adsl.tpnet.pl] has joined #code
09:38 Reiver [quassel@Nightstar-avheq5.zen.co.uk] has quit [[NS] Quit: Reblooting.]
09:39 Reiver [quassel@Nightstar-ksqup0.co.uk] has joined #code
09:39 mode/#code [+ao Reiver Reiver] by ChanServ
11:05 Emmy [Emmy@Nightstar-l49opt.fixed.kpn.net] has joined #code
11:16 catalyst [catalyst@Nightstar-ejd4sd.cable.virginm.net] has joined #code
11:16 catalyst_ [catalyst@Nightstar-ejd4sd.cable.virginm.net] has quit [Connection reset by peer]
13:50 Kindamoody is now known as Kindamoody|out
13:50 gnolam__ [quassel@Nightstar-j9ajs0.priv.bahnhof.se] has joined #code
13:54 gnolam_ [quassel@Nightstar-j9ajs0.priv.bahnhof.se] has quit [Ping timeout: 121 seconds]
15:09 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
15:09 mode/#code [+qo Vornicus Vornicus] by ChanServ
16:03 gnolam__ [quassel@Nightstar-j9ajs0.priv.bahnhof.se] has quit [Ping timeout: 121 seconds]
17:15 Vorntastic [uid293981@Nightstar-phvupn.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
20:05 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
21:19 Kindamoody|out is now known as Kindamoody
22:41 Kindamoody is now known as Kindamoody[zZz]
23:24 Emmy [Emmy@Nightstar-l49opt.fixed.kpn.net] has quit [Ping timeout: 121 seconds]
23:59
< [RMS]>
Wait, they renamed CIFS back to SMB again?
--- Log closed Mon Sep 06 00:00:17 2021
code logs -> 2021 -> Sun, 05 Sep 2021< code.20210904.log - code.20210906.log >

[ Latest log file ]