Blog
Portfolio
Sketches
Tag

Collision Detection

3 posts
Tutorial
An Algorithm for Particle Systems with Collisions

In this post we will program a particle system in p5js from scratch. We'll mainly dicuss object oriented programming and delve into the necessary physics concepts to compute collisions, all while implementing a full particle simulation with P5JS.

2023 JUN 02 · 17 min read
Tutorial
An Algorithm for Polygon Intersections

In this post we'll work our way towards an algorithm that can compute convex polygon intersections. We'll also explore a method for intersections between axis-aligned rectangles, a function that can determine the intersection of two line segments, as well as a point in polygon test.

2022 SEP 30 · 25 min read
Tutorial
A Simple Solution for Shape Packing in 2D

Shape packing is a popular type of sketch in gen-art, but is often trickier than it might seem when you try to pack anything more complicated than a simple circle. In this post we'll have a look what goes into collision detection as well as a strategy to pack any arbitrary shape in 2D.

2022 JUL 22 · 21 min read
Recent
  1. Gorilla Newsletter 106
  2. Gorilla Newsletter 105
  3. Gorilla Newsletter 104
  4. Self-modifying Quines, new HTTP QUERY Method, and Loop Engineering
Popular
  1. A Recursive Circle Packing Algorithm for Organic Growth Patterns
  2. Getting started with P5JS
  3. Creative Coding: The New Era
  4. Bowyer-Watson Algorithm for Delaunay Triangulation

Stick around

Let's make
something!

Generative art and creative coding — tutorials, deep dives, and experiments from the jungle.

New posts straight to your inbox, no spam:

ExploreHomeBlogPortfolioSketchesArchiveOther Pages
TopicsTutorialsGuidesMaking OfInterviewsNewsletter
FollowTwitter / XInstagramGitHubRSSEmail

© 2026 Gorilla Sun · Made with code & curiosity.

Written by Ahmad Moussa