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 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() * (mat.getTrans() + line);
It look good, even if I would prefer having a best way, but, I have to add the scale component now...

I don't think my code is safety or proper... so is there a "real" way to apply a Matrixd to a vec3d without transformation lost ?

Thanks,

Regards,
    Vincent.
------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
Regards,

Ferdi Smit
INS3 Visualization and 3D Interfaces
CWI Amsterdam, The Netherlands

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to