Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualhandsfelloff

Posted 26 January 2013 - 06:43 AM

Fixed it ;) For any interested please read.
Yes as I thought it was the the viewport transformation to NDC (normalized device coordinate ) coordinates:
75b617cc4ce8ff79820a327d824d5c5d.png
Code changed to this fixed it.


ray_start[0] = (x / viewer.view.viewport.width()) * 2 - 1;

ray_start[1] = -(y / viewer.view.viewport.height()) * 2 + 1;

ray_start[2] = 1;

ray_dest[0] = (x / viewer.view.viewport.width()) * 2 - 1;

ray_dest[1] = -(y / viewer.view.viewport.height()) * 2 + 1;

ray_dest[2] = 0;

Cheers,
Wilson

#2handsfelloff

Posted 26 January 2013 - 06:43 AM

Fixed it ;) For any interested please read.
Yes as I thought it was the the viewport transformation to NDC (normalized device coordinate ) coordinates:
75b617cc4ce8ff79820a327d824d5c5d.png
Code changed to this fixed it.


ray_start[0] = (x / viewer.view.viewport.width()) * 2 - 1;

ray_start[1] = -(y / viewer.view.viewport.height()) * 2 + 1;

ray_start[2] = 1;

ray_dest[0] = (x / viewer.view.viewport.width()) * 2 - 1;

ray_dest[1] = -(y / viewer.view.viewport.height()) * 2 + 1;

ray_dest[2] = 0;

Cheers,
Wilson

#1handsfelloff

Posted 26 January 2013 - 05:02 AM

Fixed it ;) For any interested please read.

Yes as I thought it was the the viewport transformation to NDC  (normalized device coordinate ) coordinates:

75b617cc4ce8ff79820a327d824d5c5d.png

Code changed to this fixed it.

 

 

    ray_start[0] =  (x / viewer.view.viewport.width())  * 2 - 1;


    ray_start[1] = -(y / viewer.view.viewport.height()) * 2 + 1;


    ray_start[2] = 1;


    ray_dest[0] =  (x / viewer.view.viewport.width())  * 2 - 1;


    ray_dest[1] = -(y / viewer.view.viewport.height()) * 2 + 1;


    ray_dest[2] = 0;

   

Cheers,

Wilson


PARTNERS