Hello Victor,

On 09/07/2012 09:55 AM, Victor Haefner wrote:
> 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?

mathematically the matrix product between a 4x4 matrix and a 3x1 matrix 
(i.e. a vector) is not defined. Since you are specifying the 3x1 matrix 
is actually a point (Pnt3f), it's 4th element is implicitly 1 and the 
multiplication can be performed. However, the result would normally be a 
4 element vector. On order to give you a 3 element point a division by 
the 4th element W is needed (so it is implicitly 1 again).
The division of course only makes sense if W != 0, so if that's the case 
you get the warning.
What is the content of the last row of your matrix?

        Cheers,
                Carsten



------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to