Skip to content

Processing demo of algorithms for bilinear and projective mapping between two quads

Notifications You must be signed in to change notification settings

bitcraftlab/quad-mapping-p5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Processing code to demonstrate algorithms for mapping between two quads.

Using a perspective transform (homography / projective geometry)

screenshot-homographic

Using bilineaer interpolation (rubber-sheet / lerping between quads)

screenshot-bilinear

This technique is used in projection mapping, laser projections etc. It re-uses some code from Benjamin Maus' laserschein library for calculating the perspective transform / homographic projections.

Mouse Interaction

Move the mouse to see how the mouse position maps from one quad to the other.
The blue dot shows what happens to the mouse position when mapped from blue quad onto the red one.
The red dot shows what happens to the mouse position when mapped from the red quad to the blue one.

Keyboard Interaction

  • [SPACE] to switch between perspective and bilinear mappings
  • [r] to reset / randomize
  • [LEFT] and [RIGHT] to change the number of columns in a grid
  • [UP] and [DOWN] to change the number of rows in a grid

License

Benjamin Maus' laserschein code is LGPL licensed.
Everything else in this sketch MIT licensed.

Links

The two mappings are also available via the JAI (Java Advanced Imaging):

Projection Mapping Libraries for Processing:

About

Processing demo of algorithms for bilinear and projective mapping between two quads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published