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 Ücretsiz · Tek tıkla abonelikten çıkma
Zeka Digest - ücretsiz
Günlük en önemli güvenlik haberi · herhangi bir zamanda alınabilir
Community Rating & Social Proof
⭐ Okuyucu Puanı
–
Ø / 5.0
★★★★★
Hiçbir okuyucu henüz yorum yok
Bu makale yararlı mıydı?
0
Powered by tsecurity.de
tsecurity.de Hub
İlgili Story Cluster & Kaynaklar (vector AI)
6 Cluster
İlgili Story Cluster & Kaynaklar (vector AI)
26 Kaynaklar
Black Friday Oura Ring deals: The best of the deals so far, picked by a wearable-tech expert
Latest from TechRadar 22 dakika önce
25 diğer kaynaklar
CCNET6 yıl önceOur Favorite Blenders of 2026 Are on Sale Ahead of Black Friday CCNET27 dakika önceBrighten Up Your Day by Saving 20% Off Flashlights With Olight’s Black Friday Sale CCNET19 dakika önceLive: Black Friday Deals Are Here. Shop Expert Picks Across Tech, Everyday Essentials and More at Up to 60% Off GGolem.de32 dakika önceAnzeige: Logitech-Tastatur MX Keys S am Black Friday zum Sensationspreis auf Amazon PPC-WELT44 dakika önceLuminar zum Black Friday: KI-Bildbearbeitung für nur 79,20 Euro LLatest from TechRadar59 dakika önceThis is the pair of open earbuds to hunt down over Black Friday LLatest from TechRadar1 saat önceBest AirPods Black Friday deals: all live savings on AirPods Pro 3 and more CComputer Bild1 saat öncePhilips Sonicare DiamondClean 9000 zum Black Friday günstiger Nnetzwelt.de2 saat önceESR startet mit Black-Friday-Rabatten: Diese AirPods-Hüllen lohnen sich jetzt Nnetzwelt.de2 saat öncePlayStation 5 geschenkt: Diese Black-Friday-Aktion legt die Konsole gratis obendrauf Nnetzwelt.de2 saat önce6 Dyson-Staubsauger im Vergleich: Dieser Sauger wird am Black Friday überraschend zum Preis/Leistungssieger Nnetzwelt.de1 saat önceMonitore im Angebot zum Black Friday: Gutes Bild für Office, Gaming und mehr GGolem.de1 saat önceAnzeige: Akkuschrauber mit 20 Bits zum Black Friday erstmals unter 50 Euro bei Amazon PPC-WELT1 saat önceDie günstigsten Handytarife an Black Friday von 10 GB bis Unlimited: Hier lohnt sich ein Wechsel PPC-WELT1 saat önceBlack Friday 2026 bei LiberNovo: Ergonomische Bürostühle mit bis zu 44 Prozent Rabatt LLatest from TechRadar1 saat önceThe best Black Friday robot vacuum deals: Dreame, Shark, Dyson, and Roborock GGolem.de1 saat önceAnzeige: Topdon-Starthilfe-Powerbank für Kfz zum Black-Friday-Bestpreis nur rund 85 Euro Hheise online News1 saat önceBlack Friday: Die besten Kopfhörer zum Tiefstpreis – Sonos Ace, Nothing & Shokz LLatest from Windows Central1 saat önceDell's Black Friday deals drop major savings on Alienware OLED monitors CCNET2 yıl önceMake Every Night Game Night and Save $90 on the Nex Playground With This Black Friday Deal DDEV Community1 saat önceThe app is part of the gadget: 14,000 App Store reviews of 28 device apps before Black Friday LLatest from TechRadar2 saat önceBlack Friday tech deals under $100 / £100: Fire TV Sticks, earbuds, coffee machines and more CCaschys Blog3 saat önceGoogle One: Black-Friday-Angebot mit bis zu 50 Prozent Rabatt Nnetzwelt.de3 saat önceDem Testsieger ebenbürtig: Zum Black Friday stürzt Xiaomis stärkster E-Scooter im Preis ab MMacerkopf.de3 saat önceFotos verbessern mit Aiarty: 52 % Rabatt + Gratisgeschenke zum Black Friday
8 Kaynaklar
CVE-2026-119727 | Red Hat Enterprise Linux 7/8/9/10 gst-plugins-bad integer underflow
VulDB Updates 1 saat önce
7 diğer kaynaklar
VVulDB Updates1 saat önceCVE-2026-119728 | Red Hat Enterprise Linux H.264 video parser null pointer dereference VVulDB Updates2 saat önceCVE-2026-104039 | Red Hat Enterprise Linux/OpenShift Container Platform PAM GSSAPI Responder denial of service VVulDB Updates2 saat önceCVE-2026-16560 | Red Hat Directory Server/Enterprise Linux 389-ds-base heap-based overflow VVulDB Updates2 saat önceCVE-2026-19548 | Red Hat Enterprise Linux ld ld/ldmain.c add_archive_element use after free VVulDB Updates2 saat önceCVE-2026-18663 | Red Hat Directory Server/Enterprise Linux 389-ds-base get_ldapmessage_controls_ext double free VVulDB Updates2 saat önceCVE-2026-12353 | Red Hat Certificate System/Enterprise Linux TLS Endpoint path traversal VVulDB Updates2 saat önceCVE-2026-18047 | Red Hat Certificate System/Enterprise Linux ACME responder web.xml improper authorization (Nessus ID 330485)
6 Kaynaklar
[NEU] [hoch] Gradle: Mehrere Schwachstellen ermöglichen Manipulation von Dateien
BSI Warn- und Informationsdienst (WID): Schwachstellen-Informationen (Security Advisories) 1 saat önce
5 diğer kaynaklar
BBSI Warn- und Informationsd…1 saat önce[NEU] [hoch] Tanium Endpoint Management: Mehrere Schwachstellen BBSI Warn- und Informationsd…1 saat önce[NEU] [hoch] Traefik: Mehrere Schwachstellen BBSI Warn- und Informationsd…2 saat önce[NEU] [mittel] Mattermost: Mehrere Schwachstellen ermöglichen Offenlegung von Informationen BBSI Warn- und Informationsd…1 saat önce[NEU] [hoch] CODESYS Visualization: Mehrere Schwachstellen ermöglichen BBSI Warn- und Informationsd…2 saat önce[UPDATE] [hoch] Oracle Financial Services Applications: Mehrere Schwachstellen
5 Kaynaklar
OpenAI and Cisco Release Shirudo Linux Security Tool
IT Security News 15 dakika önce
4 diğer kaynaklar
BBleepingComputer45 dakika önceNew Shirudo tool uses AI to shield unpatched Linux systems from exploits IIT Security News1 saat önceOpenAI, Cisco Unveil Open Source Tool to Shield Unpatched Linux Systems IIT Security News1 saat önceOpenAI and Cisco Release Open-Source Tool to Shield Unpatched Linux Systems SSecurityWeek1 saat önceOpenAI, Cisco Unveil Open Source Tool to Shield Unpatched Linux Systems
5 Kaynaklar
[NEU] [mittel] NGINX NGINX Plus: Schwachstelle ermöglicht Denial of Service
BSI Warn- und Informationsdienst (WID): Schwachstellen-Informationen (Security Advisories) 2 saat önce
4 diğer kaynaklar
BBSI Warn- und Informationsd…2 saat önce[NEU] [mittel] Google Chrome: Schwachstelle ermöglicht nicht spezifizierten Angriff BBSI Warn- und Informationsd…2 saat önce[NEU] [mittel] Check Point Zone Alarm: Schwachstelle ermöglicht Ausführen von beliebigem Programmcode mit Administratorrechten BBSI Warn- und Informationsd…1 saat önce[NEU] [mittel] React: Schwachstelle ermöglicht Denial of Service BBSI Warn- und Informationsd…1 saat önce[NEU] [hoch] Rsync: Schwachstelle ermöglicht Denial of Service
4 Kaynaklar
IT Security News Hourly Summary 2026-11-24 15h : New phpAfterShell Bug Reopens PHP2Shell Attack Path and 17 more posts
IT Security News 19 dakika önce
3 diğer kaynaklar
IIT Security News48 dakika önceNew phpAfterShell Bug Reopens PHP2Shell Attack Path IIT Security News1 saat önceIT 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 saat önceIT 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/tr/3500961/unix-ve-linux-sunucular/chipmunk-experiments/
💬 Topluluk tartışması ve yorumlar
Tartışmayı başlat: Social Chat yayın akışı veya yukarıdaki ekleme formuyla uzman katkısı gönder.