I've been playing with Chipmunk lately. It is a C library that simulates physics in two dimensions, and is intended for use in games. It's quite easy to use, but there is a bit of overhead in setting up graphics since I have to do that on my own. I'm using OpenGL through the SDL library, and it works quite smoothly. Here is the result of today's dabbling:
There are two important fundamental concepts in Chipmunk: Bodies and collision shapes. What is the difference? A body has the usual properties like mass, position, velocity, etc. However, a body does not have an area (a shape). That is the purpose of collision shapes. A collision shape does not have any of the properties of a body, it merely defines a shape (such as a circle or a rectangle). The relationship between these two concepts is that multiple shapes can be attached to a body. Only shapes can collide; bodies do not collide by themselves.
The balls in the video above were constructed using one collision shape (a circle shape) for each of the three bodies. They were rendered using an 8x8 OpenGL 2D texture (loaded from a PNG image) on a quadrilateral (GL_QUADS). Easy as pie.
The rope was more difficult to make. For a long time, the rope would either disintegrate slowly (because it was being pulled apart by gravity), or explode (the line segments would vibrate quite violently).
When making the rope, we need another fundamental Chipmunk object: The joint. Joints are used as constraints in the simulation. A constraint is something that keeps an object from moving freely. There are different kinds of joints: Pin joints, slide joints, pivot joints, and groove joints. For example, the pin joint simply stitches together two bodies at certain offsets from the body's centre. When one body moves, the joint will cause the other to follow.
My rope uses slide joints. The only difference from a normal pin joint is that the joint allows a certain flexibility: The "stitch" can be given a minimum and a maximum length, so that the bodies can get closer together or further apart before the joint's constraint takes effect. We can easily imagine the maximum length property as that of a string connecting two objects. The string will keep the objects from getting too far apart, but it will also bend if the objects are closer together than the length of the string.
The slide joints connect the line segments of the rope. Each line segment consists of four collision shapes attached to a single body. The four collision shapes are all circles, laid out side by side. These four circles have fixed positions with regards to each other. They're not actually drawn as circles, but as solid rectangles (GL_QUADS). The rope has 30 such line segments, so that's 30 bodies and 120 collision shapes.
Finally, we have two fixed bodies at either end of the rope. These bodies have infinite mass, are not affected by gravity, and have no collision shapes. (Actually, they're not added to the Chipmunk space, so they are not affected by any forces at all.) This is what keeps the rope in place. And to my great surprise, the way in which these bodies are connected to the rope seems to be what determines the quality of the simulation. At first, I was using pin joints to connect these stationary bodies to the endpoints of the rope. It wasn't until I replaced them with slide joints that the rope actually got as smooth as it is in the video above.
I'm currently toying with the idea of putting a cart with wheels on the thread and controlling the wheels with the arrow keys. If that works, I think it could make for a nice game element as a variation on the paddle of e.g. Breakout.
Update:
Intelligence View
⚡ tsecurity.de Intelligence
Chipmunk experiments
I've been playing with Chipmunk lately. It is a C library that simulates physics in two dimensions, and is intended for use in games. It's quite easy to use,…
Powered by tsecurity.de
tsecurity.de Hub
Security Briefing Gratis · 1-klik uitschrijven
Intelligence Digest gratis
Dagelijks het belangrijkste beveiligingsnieuws · kan op elk moment worden opgehaald
Community Rating & Social Proof
⭐ Lezersbeoordeling
–
Ø / 5.0
★★★★★
Nog geen recensies van lezers
Was dit artikel nuttig?
0
Powered by tsecurity.de
tsecurity.de Hub
Verwant Story Cluster & Sources (vector AI)
6 Cluster
Verwant Story Cluster & Sources (vector AI)
26 Bronnen
Black Friday Oura Ring deals: The best of the deals so far, picked by a wearable-tech expert
Latest from TechRadar 22 min. geleden
25 andere bronnen
CCNET6 jaar geledenOur Favorite Blenders of 2026 Are on Sale Ahead of Black Friday CCNET27 min. geledenBrighten Up Your Day by Saving 20% Off Flashlights With Olight’s Black Friday Sale CCNET19 min. geledenLive: Black Friday Deals Are Here. Shop Expert Picks Across Tech, Everyday Essentials and More at Up to 60% Off GGolem.de32 min. geledenAnzeige: Logitech-Tastatur MX Keys S am Black Friday zum Sensationspreis auf Amazon PPC-WELT44 min. geledenLuminar zum Black Friday: KI-Bildbearbeitung für nur 79,20 Euro LLatest from TechRadar59 min. geledenThis is the pair of open earbuds to hunt down over Black Friday LLatest from TechRadar1 uur geledenBest AirPods Black Friday deals: all live savings on AirPods Pro 3 and more CComputer Bild1 uur geledenPhilips Sonicare DiamondClean 9000 zum Black Friday günstiger Nnetzwelt.de2 uur geledenESR startet mit Black-Friday-Rabatten: Diese AirPods-Hüllen lohnen sich jetzt Nnetzwelt.de2 uur geledenPlayStation 5 geschenkt: Diese Black-Friday-Aktion legt die Konsole gratis obendrauf Nnetzwelt.de2 uur geleden6 Dyson-Staubsauger im Vergleich: Dieser Sauger wird am Black Friday überraschend zum Preis/Leistungssieger Nnetzwelt.de1 uur geledenMonitore im Angebot zum Black Friday: Gutes Bild für Office, Gaming und mehr GGolem.de1 uur geledenAnzeige: Akkuschrauber mit 20 Bits zum Black Friday erstmals unter 50 Euro bei Amazon PPC-WELT1 uur geledenDie günstigsten Handytarife an Black Friday von 10 GB bis Unlimited: Hier lohnt sich ein Wechsel PPC-WELT1 uur geledenBlack Friday 2026 bei LiberNovo: Ergonomische Bürostühle mit bis zu 44 Prozent Rabatt LLatest from TechRadar1 uur geledenThe best Black Friday robot vacuum deals: Dreame, Shark, Dyson, and Roborock GGolem.de1 uur geledenAnzeige: Topdon-Starthilfe-Powerbank für Kfz zum Black-Friday-Bestpreis nur rund 85 Euro Hheise online News1 uur geledenBlack Friday: Die besten Kopfhörer zum Tiefstpreis – Sonos Ace, Nothing & Shokz LLatest from Windows Central1 uur geledenDell's Black Friday deals drop major savings on Alienware OLED monitors CCNET2 jaar geledenMake Every Night Game Night and Save $90 on the Nex Playground With This Black Friday Deal DDEV Community1 uur geledenThe app is part of the gadget: 14,000 App Store reviews of 28 device apps before Black Friday LLatest from TechRadar2 uur geledenBlack Friday tech deals under $100 / £100: Fire TV Sticks, earbuds, coffee machines and more CCaschys Blog3 uur geledenGoogle One: Black-Friday-Angebot mit bis zu 50 Prozent Rabatt Nnetzwelt.de3 uur geledenDem Testsieger ebenbürtig: Zum Black Friday stürzt Xiaomis stärkster E-Scooter im Preis ab MMacerkopf.de3 uur geledenFotos verbessern mit Aiarty: 52 % Rabatt + Gratisgeschenke zum Black Friday
8 Bronnen
CVE-2026-119727 | Red Hat Enterprise Linux 7/8/9/10 gst-plugins-bad integer underflow
VulDB Updates 1 uur geleden
7 andere bronnen
VVulDB Updates1 uur geledenCVE-2026-119728 | Red Hat Enterprise Linux H.264 video parser null pointer dereference VVulDB Updates2 uur geledenCVE-2026-104039 | Red Hat Enterprise Linux/OpenShift Container Platform PAM GSSAPI Responder denial of service VVulDB Updates2 uur geledenCVE-2026-16560 | Red Hat Directory Server/Enterprise Linux 389-ds-base heap-based overflow VVulDB Updates2 uur geledenCVE-2026-19548 | Red Hat Enterprise Linux ld ld/ldmain.c add_archive_element use after free VVulDB Updates2 uur geledenCVE-2026-18663 | Red Hat Directory Server/Enterprise Linux 389-ds-base get_ldapmessage_controls_ext double free VVulDB Updates2 uur geledenCVE-2026-12353 | Red Hat Certificate System/Enterprise Linux TLS Endpoint path traversal VVulDB Updates2 uur geledenCVE-2026-18047 | Red Hat Certificate System/Enterprise Linux ACME responder web.xml improper authorization (Nessus ID 330485)
6 Bronnen
[NEU] [hoch] Gradle: Mehrere Schwachstellen ermöglichen Manipulation von Dateien
BSI Warn- und Informationsdienst (WID): Schwachstellen-Informationen (Security Advisories) 1 uur geleden
5 andere bronnen
BBSI Warn- und Informationsd…1 uur geleden[NEU] [hoch] Tanium Endpoint Management: Mehrere Schwachstellen BBSI Warn- und Informationsd…1 uur geleden[NEU] [hoch] Traefik: Mehrere Schwachstellen BBSI Warn- und Informationsd…2 uur geleden[NEU] [mittel] Mattermost: Mehrere Schwachstellen ermöglichen Offenlegung von Informationen BBSI Warn- und Informationsd…1 uur geleden[NEU] [hoch] CODESYS Visualization: Mehrere Schwachstellen ermöglichen BBSI Warn- und Informationsd…2 uur geleden[UPDATE] [hoch] Oracle Financial Services Applications: Mehrere Schwachstellen
5 Bronnen
OpenAI and Cisco Release Shirudo Linux Security Tool
IT Security News 15 min. geleden
4 andere bronnen
BBleepingComputer45 min. geledenNew Shirudo tool uses AI to shield unpatched Linux systems from exploits IIT Security News1 uur geledenOpenAI, Cisco Unveil Open Source Tool to Shield Unpatched Linux Systems IIT Security News1 uur geledenOpenAI and Cisco Release Open-Source Tool to Shield Unpatched Linux Systems SSecurityWeek1 uur geledenOpenAI, Cisco Unveil Open Source Tool to Shield Unpatched Linux Systems
5 Bronnen
[NEU] [mittel] NGINX NGINX Plus: Schwachstelle ermöglicht Denial of Service
BSI Warn- und Informationsdienst (WID): Schwachstellen-Informationen (Security Advisories) 2 uur geleden
4 andere bronnen
BBSI Warn- und Informationsd…2 uur geleden[NEU] [mittel] Google Chrome: Schwachstelle ermöglicht nicht spezifizierten Angriff BBSI Warn- und Informationsd…2 uur geleden[NEU] [mittel] Check Point Zone Alarm: Schwachstelle ermöglicht Ausführen von beliebigem Programmcode mit Administratorrechten BBSI Warn- und Informationsd…1 uur geleden[NEU] [mittel] React: Schwachstelle ermöglicht Denial of Service BBSI Warn- und Informationsd…1 uur geleden[NEU] [hoch] Rsync: Schwachstelle ermöglicht Denial of Service
4 Bronnen
IT Security News Hourly Summary 2026-11-24 15h : New phpAfterShell Bug Reopens PHP2Shell Attack Path and 17 more posts
IT Security News 19 min. geleden
3 andere bronnen
IIT Security News48 min. geledenNew phpAfterShell Bug Reopens PHP2Shell Attack Path IIT Security News1 uur geledenIT Security News Hourly Summary 2026-11-24 14h : EvilTokens Phishing Infrastructure Resurfaces After Microsoft Takedown With New Device-Code Attack Hosts and 13 more posts IIT Security News2 uur geledenIT Security News Hourly Summary 2026-11-24 13h : Five TEFAF robbery suspects added to EU Most Wanted and 19 more posts
Mehr aus dieser Kategorie
Blättern: Pfeiltasten [ ← ] [ → ] · Tasten j / k · mobil: Wischen
HAND-OFF
Auf Smartphone übergeben (ADVISORY)
Scannen Sie den QR-Code mit der Smartphone-Kamera für sofortigen mobilen Zugriff:
https://tsecurity.de/nl/3500961/unix-linux-servers/chipmunk-experiments/
💬 Communitydiscussie & reacties
Start de discussie in de Social Chat broadcaststream of dien hierboven een vakbijdrage in via het aanvulformulier.