News for hackers. Stuff that matters.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by TipVFL on Friday September 07, 2018 @03:49PM (#17937138)
Quaternions recently made me look pretty smart.

I was consulting at a company that's developing a VR real estate app, and the first thing I did was check to see whether they were calculating their rotations with quaternions.

It was easy to do, I just looked straight up and then turned my head to the right. My view rotated to the left, and I almost vomited. I immediately ripped the headset off and said, "You're using euler angles to calculate rotations, you need to use quaternions."

I felt pretty good about finding the biggest flaw in their system in 3 seconds.

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by Impossible on Friday September 07, 2018 @04:31PM (#17937403)
Why are they using their own custom engine with a buggy VR integration in 2018? I assume they have some kind of business reason, but based on your story it seems like whatever engineer(s) they hired couldn't follow basic integration samples and documentation.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by ipsum2 on Friday September 07, 2018 @10:21PM (#17939036)
There are many reasons to not use Unity or Unreal. One major one being that they have restrictive licenses.

The best selling/best graphics fidelity (imo) VR game Lone Echo has its own custom game engine.

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by Ralith on Friday September 07, 2018 @11:10PM (#17939183)
Even if you're writing your own engine from scratch, VR runtimes provide orientation information directly to the engine as a 4x4 transform matrix. They would have to ignore all the documentation and go far out of their way to somehow regress to euler angles, and are likely introducing other precision issues in doing so.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by dreamcompiler on Friday September 07, 2018 @11:54PM (#17939314)
4x4 transform matrices typically represent 3-space transformations with homogeneous coordinates. Rotation matrices in this framework are effectively the same thing as Euler angles. They are not quaternions.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by vvanders on Saturday September 08, 2018 @12:57AM (#17939481)
If you want to get pedantic they're also not euler angles, they're 4x4 transformation matrices.

You can pick out euler angles just as easily as calculating the quaternion by taking the basis vectors through the matrix and extracting it from there.

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by Impossible on Saturday September 08, 2018 @12:23AM (#17939389)
I'm aware of reasons for using a custom engine over Unity or Unreal, my question is what is this firms specific reason for not going that route. Also, Ready at Dawn has been developing that engine for years, and has world class engine programmers that know how to implement headtracking correctly, so the comparison isn't fair in this case.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by wolfgke on Friday September 07, 2018 @04:42PM (#17937465)
> I was consulting at a company that's developing a VR real estate app, and the first thing I did was check to see whether they were calculating their rotations with quaternions.

You had better checked whether representations are represented via spin groups (which can be represented via Clifford algebras). These work in every dimension in opposite to quaternions.

EDIT: And via pin groups (also representable via Clifford algebras), also reflections can be reprented (recall that the composition of two reflections is a rotation and any rotation can be represented this way).

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by mkl on Friday September 07, 2018 @06:53PM (#17938258)
VR is by definition 3D, so quaternions should be enough, right? The reflections method could also be done with quaternions.

Full abstraction over dimension is certainly interesting, but often not necessary.

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by wolfgke on Friday September 07, 2018 @07:02PM (#17938293)
> Full abstraction over dimension is certainly interesting, but often not necessary.

Already the capability that is works both in 2D and in 3D is in my opinion reason enough.

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by curuinor on Friday September 07, 2018 @06:09PM (#17938033)
What folks ship as a product is trivial quaternions.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by a-dub on Friday September 07, 2018 @06:12PM (#17938049)
Was it because of https://en.wikipedia.org/wiki/Gimbal_lock ?

Apollo 11 engineers made the same mistake. :)

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by skykooler on Saturday September 08, 2018 @01:50AM (#17939622)
For Apollo, it wasn't so much a "mistake" as a conscious decision to save weight. The Gemini IMU used 4 gimbals, and so avoided the issue entirely. Apollo dropped the weight of the extra gimbal and instead required the pilots to avoid flying in certain orientations.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by SomeHacker44 on Friday September 07, 2018 @06:20PM (#17938097)
I would characterize this more as a hardware engineering choice, with associated work around in software (don't rotate the spacecraft through gimbal lock/Euler angle singularity).

Disclaimer: IANARS

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by planteen on Friday September 07, 2018 @07:27PM (#17938396)
Yes large differences in orientation will make Euler angles gimbal lock. And it looks strange, even for small differences in orientation.

https://www.youtube.com/watch?v=Ocoibc7MoKg

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by sehugg on Friday September 07, 2018 @10:27PM (#17939050)
The Shuttle program used quaternions, although the ISS apparently uses a definition that is easier to read by sight: http://webcache.googleusercontent.com/search?q=cache:-ivJED8...
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by smilliken on Friday September 07, 2018 @04:02PM (#17937227)
I wrote a simple version of Google Earth for the Microsoft Surface in 2008 or so (back when Surface was a computer in the shape of a table with a touch interface). I felt pretty smart when I invented quaternions using matrices for rotating the globe, and then later realized what I was doing.
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by dreamcompiler on Friday September 07, 2018 @11:58PM (#17939326)
Yeah, no. If you're using matrix-based transforms, you're not using quaternions.

Edit: I'm oversimplifying. There's no reason you can't use both. But if you're exclusively using matrices, then by definition you're not using quaternions.

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by Ralith on Friday September 07, 2018 @11:14PM (#17939195)
> I invented quaternions using matrices

what

Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by jazzyjackson on Saturday September 08, 2018 @04:39AM (#17940084)
I read that as "I was representing my dimensions as vectors and figured out a way to use 4D matricies for the math to work out and later found out that quaternions were a thing"
Re:Quaternions: the Strange Numbers That Birthed Modern Algebra by posterboy on Saturday September 08, 2018 @04:27AM (#17940063)
Am I correct suspecting quaternions were tensors?