From: Kevin M. <ke...@vr...> - 2003-09-22 20:16:38
|
what Ben says works too, and avoids depending on internal memory ordering though you can depend on it because it will not change (because opengl's memory format is that way). ben's code reads a little better though since the operations are more apparent. kevin On Mon, 22 Sep 2003, Ben Scott wrote: > You need to dereference your matrix pointer before accessing it like an > array. Try the following code: > > const Matrix44f& mat = *entity->GetTransform(); > Vec3f out_vec(mat[2][0], mat[2][1], mat[2][2]); > > cheers, > -Ben > > > How this is the right list: What is the recommended method for grabbing an > > entire column? > > > > Can't seem to find a general GetColumn() routine in the Matrix definition. > > I can't seem to even grab the components and throw them in a vector when > > the Matrix44f is a pointer. > > > > Matrix44f* mat = entity->GetTransform(); // GetTransform() returns > > Matrix44f* > > Vec3f out_vec(mat[2][0],mat[2][1],mat[2][2]); > > > > yields: > > > > error C2664: 'gmtl::Vec<DATA_TYPE,SIZE>::Vec(const DATA_TYPE &,const > > DATA_TYPE &,const DATA_TYPE &)' : cannot convert parameter 1 from > > 'gmtl::Matrix<DATA_TYPE,ROWS,COLS>::RowAccessor *' to 'const float &' > > > > Any help would be greatly appreciated. > > > > cheers > > > > E. > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > ggt-devel mailing list > > ggt...@li... > > https://lists.sourceforge.net/lists/listinfo/ggt-devel > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > ggt-devel mailing list > ggt...@li... > https://lists.sourceforge.net/lists/listinfo/ggt-devel > -- *--*---*---*----*-----*------*------*-----*----*---*---*--* Kevin Meinert /_/ home - http://www.vrsource.org/~kevin \ / music - http://www.subatomicglue.com \/ __ \/ \__ \_\ |