Boost logo

Boost Users :

From: Jonathan Brandmeyer (jbrandmeyer_at_[hidden])
Date: 2005-04-13 13:46:11


On Wed, 2005-04-13 at 19:47 +0200, Malte Clasen wrote:
> Hi,
>
> is the uBLAS library memory compatible to OpenGL vector and matrix
> operations? I'd like to use a single representation for both internal
> maths and the rendering interface of my application. OpenGL expects a
> pointer to a float or double C-array. For example 4x4 matrices are
> stored linearly as 16 values.

OpenGL expects column-major ordering for 4x4 matrices, whereas uBLAS is
row-major by default. Try something like
typedef ublas::matrix<double, ublas::column_major,
ublas::bounded_array<double, 16> > gl_matrix;

HTH,
-Jonathan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net