pointerpointer.com's use of voronoi, canvas, and javascript
Sign in to YouTube
Sign in to YouTube
Sign in to YouTube
Published on Jun 11, 2012
I explain a little bit behind how pointerpointer.com was built.
Thx to @markwithasee to showing the site to me
Just to be clear about the canvas. it's offset in the page because its used as a buffer canvas, mouse positions within the picture frame are sent over to it, and the offsets are determined relative to the canvas. So when I turn on the canvas, it looks like its in the wrong place but technically it doesn't need to be.
Lastly, the colors used in the canvas are there because in order to find which shape encloses your pointer, we can just just look up the pixel data and see what color is under the cursor, and thus the connection from color to shape to image. (thx rhys!)
-
Category
-
License
Creative Commons Attribution license (reuse allowed)
Loading...
Loading...
Loading...
Loading...
Loading...
-
48:04
Albert Einstein- How I See the Worldby Nam NgoFeatured
2,638,139
-
24:30
Fluent 2012: Paul Irish, "Javascript Development Workflow of 2013"by OreillyMedia
50,646 views
-
40:48
HTML5 Boilerplate Walkthroughby Paul Irish
50,816 views
-
4:35
Whipped chocolate made with high pressure nitrous oxideby Ben Krasnow
22,478 views
-
7:30
How to cook an Omelette - Cooking Tips - Cooking Tricks - Cooking Tutorials - Simon's Cooking Showby SimonsCookingShow
3,390 views
-
19:45
Interaction Design Engineering for JavaScript with Matt Kelly from ZURBby MarakanaTechTV
2,093 views
-
2:48
Blender Demolition - Case Study: World Trade Center (Demo 3)by KaiKostack
2,141,128 views
-
20:13
Modernizr's test suite: Behind the Scenesby Paul Irish
9,648 views
-
53:40
10 Things I Learned from the jQuery Sourceby Paul Irish
64,930 views
-
26:22
The Julian Assange Show: Cypherpunks, Part 1 (E8, p.1)by RussiaToday
61,219 views
-
21:29
Dark Souls With James PT. 166 - The Painted Worldby GameFrontDotCom
8,350 views
-
37:07
The Primitives of the HTML5 Foundationby Paul Irish
23,757 views
-
2:58
classList for Great Good!by Paul Irish
5,863 views
-
28:45
11 More Things I Learned from the jQuery Sourceby Paul Irish
19,898 views
-
5:46
Why Is Yawning Contagious?by Vsauce
2,422,111 views
-
1:44
Seven Databases in Songby jimbojron
47,293 views
-
11:45
html5 canvas animation basics tutorial for beginners javascript programming lessonby Adam Khoury
32,686 views
-
17:26
Working Holiday Part 2: Morocco and choosing lensesby cameralabs
17,405 views
-
2:09
biggest best strikeout in historyby SPTARUALW
1,756,472 views
-
28:11
The Build Script of HTML5 Boilerplate: An Introductionby Paul Irish
72,455 views
- Loading more suggestions...
Top Comments
Brendan Hemens 11 months ago
Great breakdown. I think the "ahead-of-time" stuff is a big part of what makes pointerpointer amazing...there seem to be a lot of photos involved - I wondered if they used some kind of machine learning algorithm to figure out where the fingers in the photos are pointing.
Sign in to YouTube
Sign in to YouTube
dag101101 11 months ago
Voronoi is an incredibly simple concept. Out of a field of points, at any given coordinate, find whatever point is closest to you, and you're part of that point's region. So if you have a field of colored points, and then iterated over each pixel in the screen and made that pixel's color the color of its closest point, then you'd see a voronoi diagram!
Sign in to YouTube
Sign in to YouTube
All Comments (19)
Alex Zagorodniuk 5 months ago
im quite curious what are the chrome extension PI uses. who can tell by icons?
Sign in to YouTube
Sign in to YouTube
Sarah Cartwright 9 months ago
Fuck, I'd use a standard grid, and just select with a small equation....
boxNumberCursorIsIn=int(x/10)+int(y/10*10);
Alternatively, find the centre of the boxes, and then find the closest point to the mouse.
Using what they have, seems a bit overkill!
Sign in to YouTube
Sign in to YouTube
Jérôme Cukier 11 months ago
They might have, but i think it's faster to do manually. Search flickr for photos tagged with finger pointing. Once you have 400 or so, for each determine one or several points where the finger is pointing to (like make a slide show and record clicks). Once you know what point refers to what image, voronoify! It's a great idea
Sign in to YouTube
Sign in to YouTube
Matthew Harris 11 months ago
I checked out the voronoi diagram behind the scenes and then tried to trick it by moving my pointer around some of the big "cells" in the diagram where the author(s) hadn't found many pictures.
The script surprised me by still being super accurate! I guess it also recenters the image on the point in that cell as well. Nice extra touch.
Sign in to YouTube
Sign in to YouTube
Matthew Harris 11 months ago
Read the first comment, it explains why you would use a voronoi grid to get better accuracy
Sign in to YouTube
Sign in to YouTube
mehulkar 11 months ago
I don't understand why the Voronoi grid is necessary if all the source images have already been mapped to a grid point?
Sign in to YouTube
Sign in to YouTube
Vinay Menon 11 months ago
Nice. I guess you can do this with just css using '~' selector.
Sign in to YouTube
Sign in to YouTube
Zemnmez 11 months ago
Well, the diagram ensures that the whole space is covered by at least one image, that perhaps would be more difficult to accomplish using just collision testing and a set of xy coords.
Sign in to YouTube
Sign in to YouTube
marcbaiges 11 months ago
more than than doing mouse x,y collision testing against a rectangular cell? Can't imagine how... but sure I'm missing something, thanks! :)
Sign in to YouTube
Sign in to YouTube