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 coords to world you do:
>
>  v_world = v_local * ModelMatrix;


Yes ! I haven't seen that operator (post-mult) ! I sounds good now !

A lot of thanks :-)

Regards,
    Vincent.


>
>
> Robert.
>
>
> On Wed, Dec 10, 2008 at 4:31 PM, Vincent Bourdier
> <[EMAIL PROTECTED]> 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
> >
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to