5 ms·
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 se
by TipVFL 8y ago
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.
- smilliken 8y agoI 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.
- Ralith 8y ago> I invented quaternions using matrices what
- posterboy 8y agoAm I correct suspecting quaternions were tensors?
- jazzyjackson 8y agoI 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"
- dreamcompiler 8y agoYeah, 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.
- Impossible 8y agoWhy 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.
- ipsum2 8y agoThere 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.
- Ralith 8y agoEven 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.
- dreamcompiler 8y ago4x4 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.
- vvanders 8y agoIf 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.
- Impossible 8y agoI'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.
- wolfgke 8y ago> 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).
- curuinor 8y agoWhat folks ship as a product is trivial quaternions.
- mkl 8y agoVR 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.
- wolfgke 8y ago> 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.
- a-dub 8y agoWas it because of https://en.wikipedia.org/wiki/Gimbal_lock https://en.wikipedia.org/wiki/Gimbal_lock ? Apollo 11 engineers made the same mistake. :)
- SomeHacker44 8y agoI 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
- planteen 8y agoYes 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 https://www.youtube.com/watch?v=Ocoibc7MoKg
- sehugg 8y agoThe 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:-ivJED8B0uYJ:highorder.berkeley.edu/proceedings/aiaa-annual-2009/paper1025.pdf http://webcache.googleusercontent.com/search?q=cache:-ivJED8...
- skykooler 8y agoFor 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.