<div dir="ltr">In the latest release of the boost libraries (1.62.0) there is an interesting little header only library called QVM:<div>"</div><div><div><h1 style="font-size:24pt;clear:left;padding-top:5pt;padding-bottom:5pt;margin-top:0px;margin-bottom:0px">QVM: Quaternions, Vectors, Matrices</h1></div><div class="gmail-RenoIncludeDIV" style="padding:0px;margin:0px"><p style="font-size:13.3333px;padding-top:5pt;padding-bottom:5pt;margin-top:0px;margin-bottom:0px;clear:right;color:rgb(0,0,0);font-family:trebuchet,verdana,arial,helvetica,sans">Boost QVM is a generic library for working with <b>q</b>uaternions, <b>v</b>ectors and <b>m</b>atrices of static size with the emphasis on 2, 3 and 4-dimensional operations needed in graphics, video games and simulation applications.</p><h3 style="font-size:14pt;clear:left;padding-top:15pt;padding-bottom:5pt;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-family:trebuchet,verdana,arial,helvetica,sans">Introduction</h3><p style="font-size:13.3333px;padding-top:5pt;padding-bottom:5pt;margin-top:0px;margin-bottom:0px;clear:right;color:rgb(0,0,0);font-family:trebuchet,verdana,arial,helvetica,sans">In graphics and simulation applications, there is a need for a library that makes it easy to perform 2D and 3D transformations efficiently. C++ makes it possible to define vector and matrix types and to overload various operators to implement the standard algebraic operations. Because this is a relatively straightforward process, there are many such libraries in existence, each with its own types and operator overrloads. Such libraries are typically part of a higher level system, such as a graphics engine or a 3D modeling API. As a result, it is typical for programmers to have to integrate and to translate between several different quaternion, vector and matrix types that come with the various APIs they use.</p><p style="font-size:13.3333px;padding-top:5pt;padding-bottom:5pt;margin-top:0px;margin-bottom:0px;clear:right;color:rgb(0,0,0);font-family:trebuchet,verdana,arial,helvetica,sans">On the other hand, performance considerations often lead to matrix and vector types becoming coupled with a particular platform, or to (over time) acquire various <i>#ifdefs</i> needed to enable optimizations through platform-specific compiler features that control the physical format or layout of their elements. However, such optimizations may interfere with ease of use and portability; for example on some platforms requiring 16-byte alignment for matrix types makes them incompatible with standard containers.</p><p style="font-size:13.3333px;padding-top:5pt;padding-bottom:5pt;margin-top:0px;margin-bottom:0px;clear:right;color:rgb(0,0,0);font-family:trebuchet,verdana,arial,helvetica,sans">Boost QVM solves both of these issues by decoupling the standard algebraic operations from the types they operate on -- without compromising type safety.</p><div><br></div></div></div><div>"</div><div>see: <a href="http://www.boost.org/doc/libs/1_62_0/libs/qvm/doc/index.html">http://www.boost.org/doc/libs/1_62_0/libs/qvm/doc/index.html</a></div><div><br></div><div>I knocked up a little example and it seems easy to use.</div><div><br></div><div>Andrew</div><div><br>-- <br><div class="gmail_signature">___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________</div>
</div></div>