#127: Map Editor: Replace angles with quaternions

1 view
Skip to first unread message

Cafu Trac

unread,
Jan 14, 2013, 10:31:55 AM1/14/13
to cafu...@googlegroups.com
#127: Map Editor: Replace angles with quaternions
-------------------------+----------------------
Reporter: Carsten | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: other | Version: svn-head
Keywords: | Platform:
-------------------------+----------------------
In the Map Editor and in the `.cmap` map files, we still use triples of
''angles'' (heading, pitch and bank) in order to describe the orientation
of map primitives and map entities.

This however is fraught with problems: The use of angles suggests an
intuitive and easy to understand method to specify the orientation of an
object, but it turns out that that is a serious misconception.

Applying or using angles requires additional, implicit knowledge:
- In what order must the rotations about the angles be applied?
- Will a positive angle rotate clockwise or counter-clockwise?
- Do all-zero angles correspond to the identity transformation?

That is, both humans who read a `.cmap` file in a text editor as well as
all any code that converts to and from angles must be acutely aware of
these details, and follow them in the exact same manner.

As a result, for specifying the orientation of objects, we should replace
angles with the basis vectors of the objects local system, or quaternions.

The use of basis vectors / the 3x3 rotation matrix would be
straightforward and simple, but also be overly verbose and give room for
new questions, e.g. what if we find a non-orthogonal basis in a map file?

Consequently, using quaternions as a robust, easy to understand and
unambiguous method to express rotations / orientations, and their
unequivocal conversions to and from rotation matrices, seems to be a
logical step.


Note that the use of quaternions should only be "internally" -- graphical
user interfaces in the Map Editor should still present angular
representations of rotation to the user, and convert to and from
quaternions as necessary.

--
Ticket URL: <http://trac.cafu.de/ticket/127>
Cafu 3D Game and Graphics Engine <http://www.cafu.de>
The open-source game engine and graphics engine for multiplayer, cross-platform, real-time 3D action.

Cafu Trac

unread,
Sep 6, 2014, 5:53:41 AM9/6/14
to cafu...@googlegroups.com
#127: Map Editor: Replace angles with quaternions
--------------------------+----------------------
Reporter: Carsten | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: other | Version: svn-head
Resolution: outdated | Keywords:
Platform: |
--------------------------+----------------------
Changes (by Carsten):

* status: new => closed
* resolution: => outdated


Comment:

This ticket has been implemented in the course of the introduction of the
Entity Component System: The "Transform" components use quaternions to
keep the orientation of their entities.

--
Ticket URL: <http://trac.cafu.de/ticket/127#comment:1>
Reply all
Reply to author
Forward
0 new messages