Hello Andreas,

Andreas Halm wrote:
> I got a warning when using multFull with a Vec3f, but the warning went away
> when converting the Vec3f to Pnt3f first ...
> 
> OSGMatrix.inl line 1508:
>     ValueType w = _matrix[0][3] * pntIn[0] +
>                   _matrix[1][3] * pntIn[1] +
>                   _matrix[2][3] * pntIn[2] +
>                   _matrix[3][3];
> 
> OSGMatrix.inl line 1620:
>     ValueType w = _matrix[0][3] * vecIn[0] +
>                   _matrix[1][3] * vecIn[1] +
>                   _matrix[2][3] * vecIn[2];    
> 
> Is there a reason for this?

yes, a vector v represents a direction, so in homogeneous coordinates 
v[3] == 0, for a point p (representing a position) p[3] == 1, which is 
why the w above is computed differently. This distinction is only 
relevant for the 3 component case, when Vec4f or Pnt4f are used the last 
component is explicitly given and both should behave the same way.

For the Vec3 case we should probably remove the warning since there is 
nothing wrong when the above w == 0. For Pnt3 I'm less sure as it 
indicates that the point is transformed to an infinitely far away point 
and those can not be represented by Pnt3 (you need a Pnt4 for that).

        Cheers,
                Carsten

------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to