tags:

views:

57

answers:

1

Hi everybody, I'm currently trying to use Eigen math library with Opengl. I've some typedefs for Vector3f from Eigen, say Vec3, so that I can use it as a coord for my vertices. I also have a structure for a vertex with coord (vec3), normal (vec3) and color(vec4). When I try to use vertex arrays (I'll use VBOs once I make vertex arrays work properly) it seems there is a problem with OpenGL processing Eigen's Vector3f as coords... Has any of you dealed with these issues??

Thanks in advance.

A: 

In Eigen, Vectors are Matrices (cf http://bitbucket.org/eigen/eigen/src/e17630a40408/doc/AsciiQuickReference.txt line 12)

I suspect Matrices to own not only the data, but only additional information, like its size. What's more, it packing may be weird.

So, what does sizeof(Eigen::Vector3f) returns ? If it's 3xsizeof(float) = 12, the problem is elsewhere.

How do you setup and draw your array, by the way ?

Calvin1602