#1334·matter-js

Simulate 2 cogwheels

Author: bilogicCreated Mar 17, 2025Updated Jul 14, 2026

Hi,

My codepen https://codepen.io/GS1234/pen/PwoQPVo

  1. I'm really new to this and would like to simulate 2 cogwheels
  2. Make the 1st cogwheel turn
  3. 2nd should turn as a result
  4. I'm able to make a bodies.circle(...) spin by Constraint.create(...) it to another circle that IsStatic: true
  5. I also wanna spin the cogwheels really fast, so building off this example https://codepen.io/garena-tw-eng/pen/bGzverg
  6. Changing the speed from 0.055 to 0.555 on line 134 and 136, fire 1 lipstick
  7. The lipstick start to rotate instead of having its tip being pinned to the spinning target