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() *
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
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
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...
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 *
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
6 matches
Mail list logo