[vtk-developers] FYI: Boost QVM

Andrew Maclean andrew.amaclean at gmail.com
Fri Sep 30 20:29:16 EDT 2016


In the latest release of the boost libraries (1.62.0) there is an
interesting little header only library called QVM:
"
QVM: Quaternions, Vectors, Matrices

Boost QVM is a generic library for working with *q*uaternions, *v*ectors
and *m*atrices of static size with the emphasis on 2, 3 and 4-dimensional
operations needed in graphics, video games and simulation applications.
Introduction

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.

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 *#ifdefs* 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.

Boost QVM solves both of these issues by decoupling the standard algebraic
operations from the types they operate on -- without compromising type
safety.

"
see: http://www.boost.org/doc/libs/1_62_0/libs/qvm/doc/index.html

I knocked up a little example and it seems easy to use.

Andrew

-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20161001/dd1363e4/attachment.html>


More information about the vtk-developers mailing list