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);
- QVector3D nearPlane(conv_x, conv_y, -1);
- QVector3D farPlane(conv_x, conv_y, +1);
- //Multiply per the inverted ModelView matrix, to get world space coordinates
- nearPlane = nearPlane * cam_m.inverted(); // 3d vector * 4x4matrix...
- farPlane = farPlane * cam_m.inverted();
- QVector3D direction = nearPlane - farPlane;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement