Project 2a
©Jorg Peters
Points: 5+5+5
Purpose
Learn to move objects via the mouse in OpenGL
Set up
use this new
code base
Declare any online code by stating the link in your code.
Task 1: Create Scene
Display 8 points on the screen each of a different color and arranged uniformly on a circle.
Task 2: Picking
Use orthogonal projection!
-
While mouse is held down, the color of the selected point becomes white to highlight it.
-
Restore the original color upon release.
Task 3: Dragging
Implement the ability to move the points with the mouse
Make all points suitably large.
- The OpenGL window origin (0,0) is bottom-left,
whereas the mouse reports with (0,0) on top-left
- In order to map mouse to world coordinates
-
retrieve the cursor position
using
glfwGetCursorPos
-
obtain world coordinates
using
glm::unProject(glm::vec3(---,---, 0.0), ModelMatrix, ProjectionMatrix, vp)
where "---" is a place-holder for your code and vp is short for Viewport.
- Consult web OGL documentation!
WHAT TO SUBMIT
- Your modified source files
(.cpp's, shaders, etc)
- A link to a screen capture of your
running program showcasing the implementation
of all of the tasks using
recordit (Mac, Win)
or similar software.