Final Project: Arduino, Matter JS, Geometry and Rotation

September 7, 2021

Tips on Matter JS

  1. If you have separate objects for a visual and for the physics, then you can introduce problems. A better strategy is to do everything to the physics objects, and then reveal them how you'd like as close to the running of the program as possible. Also, if you suspect that your physics and your visuals are off (I problem I ran into for quite some time!), you can draw shapes directly using the vertex positions of objects. The visual makes debugging a million times easier.
  2. If things aren't working, make sure that you've not only created the object but have also added it to the world. Take you time, and check that each object is in the world how you want it, before adding additional functionality and using the objects.
  3. When working with angles or rotation with MatterJS in p5, check that you have them both set to be working in radians or degrees. (They have different default settings).
  4. If you are building one that is complex, it's better to build it with several simpler things, then with one complex thing.

No items found.