Hi all,

What I do:
 - I turn the camera around the y axis when I move the mouse
 - I call calcViewRay every frame and write the x component of the ray
direction to a log file:

http://www.flickr.com/photos/86793018@N05/7949716088/in/photostream/lightbox/

The problem are the peaks..
I tracked them down to the multFull function in OSGMatrix.inl (below).

pntIn is Pnt3f(rx, ry,  1) and looks fine (I plotted rx and ry).

The Matrix seams ok:

matrix[3][3] always around 25

For every peak I show I get the error message that w == 0.0, I checked all
values but could not find something wrong :(

http://www.flickr.com/photos/86793018@N05/7949713038/in/photostream/lightbox/

It could somehow be related to the way I set my transformation matrices (I
use from at up vectors and use the MatrixLookAt function)

Any idea where this could come from, what is the meaning of w?

Best Regards,

Victor






template <class ValueTypeT>
inline void
    TransformationMatrix<ValueTypeT>::multFull(
        const PointType3f &pntIn, PointType3f  &pntOut) const
{
    ValueType w = _matrix[0][3] * pntIn[0] +
                  _matrix[1][3] * pntIn[1] +
                  _matrix[2][3] * pntIn[2] +
                  _matrix[3][3];

    if(w == TypeTraits<ValueType>::getZeroElement())
    {
        FWARNING(("TransformationMatrix<>::multFull(Pnt3, Pnt3): w ==
0.0\n"));

        pntOut.setValues(
            (_matrix[0][0] * pntIn[0] +
             _matrix[1][0] * pntIn[1] +
             _matrix[2][0] * pntIn[2] +
             _matrix[3][0]             ),
            (_matrix[0][1] * pntIn[0] +
             _matrix[1][1] * pntIn[1] +
             _matrix[2][1] * pntIn[2] +
             _matrix[3][1]             ),
            (_matrix[0][2] * pntIn[0] +
             _matrix[1][2] * pntIn[1] +
             _matrix[2][2] * pntIn[2] +
             _matrix[3][2]             ) );
    }
    else
    {
        w = TypeTraits<ValueType>::getOneElement() / w;

        pntOut.setValues(
            (_matrix[0][0] * pntIn[0] +
             _matrix[1][0] * pntIn[1] +
             _matrix[2][0] * pntIn[2] +
             _matrix[3][0]             ) * w,
            (_matrix[0][1] * pntIn[0] +
             _matrix[1][1] * pntIn[1] +
             _matrix[2][1] * pntIn[2] +
             _matrix[3][1]             ) * w,
            (_matrix[0][2] * pntIn[0] +
             _matrix[1][2] * pntIn[1] +
             _matrix[2][2] * pntIn[2] +
             _matrix[3][2]             ) * w );
    }
}
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to