Log In  


Cart #spiro-4 | 2024-07-12 | Embed ▽ | License: CC4-BY-NC-SA
12

Updated version that allows you add and remove pens and control the size of the cog etc.

Note the size of the Wheel is set. The size of the cog is derived by the amount of teeth on the cog. This is to ensure that the teeth of the big wheel and the small cog work together.

A simple toy to play with. I was going to add a UI for adding pens changing the colours of the pens. Changing the number of teeth in the wheel etc but probably won't do that.

Feel free to play around with the code. Changing the number of teeth on the wheel will change the ratios for getting back to the same place.

Pens are just objects with 3 values the angle of the pen (0-1) the distance in radiuses of the pens 0-1 and the colour.

If you change the number of teeth on the cog the cog will change size accordingly.

12


This is so cool. Does this use Johan Gielis' superformula? I've been thinking about using the superformula in a shmup or infinite runner to generate random enemies/obstacles.


@DiscoSoup sorry I don't know what the superformula is. This is just trig.

I'm glad you enjoyed it.



[Please log in to post a comment]