Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- qreal conv_x = ( (mousex / (854.0/2.0)) -1);
- qreal conv_y = ( (mousey / (480.0/2.0)) -1);
- QVector4D nearPlane(conv_x, conv_y, -1, 0.0);
- QVector4D farPlane(conv_x, conv_y, +1, 0.0);
- //Multiply per the inverted ModelView matrix, to get world space coordinates
- QVector4D nearPlane2 = nearPlane * cam_m.inverted();
- QVector4D farPlane2 = farPlane * cam_m.inverted();
- QVector4D direction = farPlane2 - nearPlane2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement