Skip to content
LU JI edited this page Dec 18, 2018 · 6 revisions

Welcome to the project wiki!

TODO:

  • init buffers and local cache
  • Program::eventhandler -> detect mouse drag
  • Mouse.cpp
    • handleMouseDown()
    • getMousePos()
  • setup shaders
  • particle auto-update with mouse info
  • render
  • update

DEBUG

  • testing particles data are auto-updated for each frame on CPU side
  • pass camera matrix as uniform
  • test data is actually passed to GPU
  • test gl draw procedure is correct.
  • fix click is off when cam is not centered
  • color
  • slow down resistance
  • why it went crazy on long click?

Analysis

Animation

Particle movement is caused by gravitational force, the stronger the force the darker the color of its appearance.

  • Click generates a force onto surrounding particles and leaving those particles with an initial speed the same as mouse moving speed;
  • Particle color is determined by the acceleration speed.
  • Acceleration is caused by gravitational force to the mouse. i.e. The closer a particle to the mouse(when clicked down) position, the bigger its acceleration.
    • If the click holds, each particle's the acceleration vector (in terms of both direction and magnitude) keeps changing towards the the pointer for every frame;
      (e.g. new_acceleration = current_acceleration + new_gravitational_acceleration)
    • If mouse releases, the particle will slow down, due to a constant resistence force, to stationary.

Interactivity

Mouse

Control Description
Scroll Wheel Zoom In/Out
Click Applys gratational force to surrounding particles

Keyboard

Control Description
Left⇧ Zoom In
Left⌃ Zoom Out
←, ↑, →, ↓ Move Around

Implementation

Structs

1. Particle

Particle
vec2 acceleration
vec2 speed
vec2 pos

2. MouseDown

MouseDown
vec2 pos

Globals/Constants

All constants are in constants.h file.