Advertisement
faenil

Untitled

Oct 17th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. qreal conv_x = ( (mousex / (854.0/2.0)) -1);
  2. qreal conv_y = ( (mousey / (480.0/2.0)) -1);
  3.  
  4. QVector4D nearPlane(conv_x, conv_y, -1, 0.0);
  5. QVector4D farPlane(conv_x, conv_y, +1, 0.0);
  6.  
  7. //Multiply per the inverted ModelView matrix, to get world space coordinates
  8. QVector4D nearPlane2 = nearPlane * cam_m.inverted();
  9. QVector4D farPlane2 = farPlane * cam_m.inverted();
  10.  
  11. QVector4D direction = farPlane2 - nearPlane2;
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement