Closed kugimasa closed 4 years ago
glutPassiveMotionFunc()
: Get the cursor position in the window (x, y) when nothing is pressed
Commit here
The origin of Cursor Coordinate System and Display Coordinate System is different
Commit here
displayX = 2.0 * (cursorX / w) - 1.0
displayY = - 2.0 * (cursorY / y) + 1.0
Commit here
x = cos(theta)
y = sin(theta)
The 3 vertexes' position
theta = PI/2
Commit [here]()
theta = 7PI/6
theta = 11PI/6
Commit [here]()
GOAL
The cursor draws the triangle. The triangle gets bigger(or smaller).
[x] Input from cursor using GLUT
[x] Draw triangle
[x] Match coordinate system
[x] Draw triangle in polar coordinate system
[x] Move triangle according to cursor position
[x] Change triangle size
[x] Change triangle color
[x] Draw triangle when cursor is not moving
[x] Add motion blur