[osg-users] Matrixd vs Vec3d ..

2008-12-10 Thread Vincent Bourdier
Hi, Just a problem of math OSG : I have * a vec3d point in relative coordinate * a matrix to transform in world coordinate I need to make something equivalent to vec = mat * vec ... But the 3d vector cannot be trnasformed by a matrix (4*4) ... For the moment I do : line = mat.getRotate() *

Re: [osg-users] Matrixd vs Vec3d ..

2008-12-10 Thread Ferdi Smit
Add a homogeneous coordinate of 1.0 to the vector (i.e. 4th component). However, this does incur a bit of overhead as it will probably do some extra multiply-adds. Vincent Bourdier wrote: Hi, Just a problem of math OSG : I have * a vec3d point in relative coordinate * a matrix to

Re: [osg-users] Matrixd vs Vec3d ..

2008-12-10 Thread Thrall, Bryan
Vincent Bourdier wrote on Wednesday, December 10, 2008 10:31 AM: Hi, Just a problem of math OSG : I have * a vec3d point in relative coordinate * a matrix to transform in world coordinate I need to make something equivalent to vec = mat * vec ... But the 3d vector cannot be

Re: [osg-users] Matrixd vs Vec3d ..

2008-12-10 Thread Vincent Bourdier
Hi, Yes the operator run well, but the translation in the matrix in ignored (4th colomn)... I have a translation matrix, I use the operator on a vec3... and the result is a little vector (from ~100 unit lengh to 0.0001 unit, with a translation of ~3000,-2000,1500) I do not understand all...

Re: [osg-users] Matrixd vs Vec3d ..

2008-12-10 Thread Robert Osfield
Hi Vincent, The OSG's support for Vec3 * Matrix does an implicit case up to Vec4, and the does the w divide, so what you are getting is Vec4(Vec3,1) *Matrix. The OSG convention is also post multiplication so to convert an objects from local coords to world you do: v_world = v_local *

Re: [osg-users] Matrixd vs Vec3d ..

2008-12-10 Thread Vincent Bourdier
2008/12/10 Robert Osfield [EMAIL PROTECTED] Hi Vincent, The OSG's support for Vec3 * Matrix does an implicit case up to Vec4, and the does the w divide, so what you are getting is Vec4(Vec3,1) *Matrix. The OSG convention is also post multiplication so to convert an objects from local