FRUK-Simulator / Simulator

First Robotics UK Simulator
https://sim.morethanrobots.uk/
MIT License
5 stars 17 forks source link

Add Lesson 4 #193 #221

Closed ido-ran closed 2 years ago

ido-ran commented 2 years ago

Add 2 challenges for lesson 4 to use the color sensor.

ido-ran commented 2 years ago

I've noticed something seems strange with the color sensor events from plank. When I've activated the Tick Physics debug option I've noticed that the definition of polygon zone for threejs seems to be very different from that of plank. The following image shows it.

image

As you can see from the image, while the threejs has a "step" at the top left corner, plank has a direct line connecting the two corners.

JamesWP commented 2 years ago

Maybe we should add some algorithm to turn these non convex polygons into a series of smaller convex polygons, there are a few algorithms which can do this iirc