Press escape to exit fullscreen

{{sketch.instructions}}

CC {{sketch.licenseObject.short}}

Archived Sketch

This sketch is created with an older version of Processing,
and doesn't work on browsers anymore.

View Source Code

Capture Screenshot

Blob Intersection Test

{{$t('general.by')}}
Uses Ryan Alexander's line-line intersection test to check if a point is inside or outside an irregular blob (The point being the mouse). Checks a ray from the right of the point, if it hits an even number of edges of the blob, it's outside (odd means it's inside). Plus some other rules for when the ray is only intersecting a point on the blob, and not a line segment of it. As always, there's probably a better way of doing this, I'm no expert, but this works. I've tried it with blobs in OpenCV blob detection and it works, some fun possibilities there perhaps.
We recovered an unsaved version of this sketch. Please review your changes below.

As a Plus+ Member feature, this source code is hidden by the owner.

  • {{co.title}}
    {{$t('sketch.mode-pjs')}} {{$t('general.learnMore')}}
    Select mode or a template
    {{liveCodeLink}}
    • {{l.url.substr(l.url.lastIndexOf('/') + 1)}}
    {{$t('sketch.layoutDescription')}}

    {{k.category}}
    {{k.label}}
    {{k.description}}

    {{$t('sketch.seeMoreShortcuts')}}

    Versions are only kept for 7 days.
    Join Plus+ to keep versions indefinitely!

    {{$t('general.joinPlus')}}


    {{$t('sketch.versionsSummarized')}}