Saturday, 14 December 2013

Peano Curve

For this demo we travel back to the 19th Century Peano Curve - a space filling curve discovered 1890 by Italian mathematician Guiseppe Peano. He went on to some interesing work in Fractals.

Whilst researching the Peano curve, I found the best way to implement it was recursively and a Python sample showed a neat example using Turtle Graphics. Turtle Graphics was always in those computer books I grew up with (1980s!) complete with robot turtle usually with a pen attached. I had never actually code anything using it- turns out a basic turtle class is pretty easy so I chose this to implement this demo. It is a very fun abstraction / model. I threw in some colour to liven things up and rendered to the HTML5 Canvas. Hopefully I will revisit the turtles soon and have an animate implementation of the Curve. For now, here is the live demo and the GitHub.

Can someone work on the robot for me? I'll bring the pens :-)

This Week in Dart #19

Back after a small hiatus caused by the American Thanksgiving Holiday and the British theatre tradition of pantomime! Here's a catch up TWID...

The Dart DEV channel was updated Dart Editor version 1.0.3_r30939 (DEV) and the Dart SDK version 1.0.3.0_r3093. I am enjoying the new clearer tooltips.

The Rosetta Code site provides source code for classic computer demos and problems in a variety of languages. On one page I noticed 173 programming languages! I was happy to see that many of them had Dart versions. Well worth checking out.

Dart Dares kicked off on G+ is a bit of fun coding challenge that started with a Secret Santa problem. See the post here. I hope this continues into the new year!

Minecraft creator Notch has continued to Tweet his Dart and WebGL experiments. He also announced he will be taking part in LD28 48 hour game challenge using these technologies. As usual he will be streaming the weekend.

I'm off to watch Notch - watch out for another HTML5 GFX demo later on the blog.

Monday, 2 December 2013

Interactive Isometric Landscape Generator - Dart HTML5 Canvas

Landscape generation has always got my attention - starting with fault line graphics generation back on the 8-bit Dragon 32. That required some patience! I have spend a good deal of hobby computer time on various GFX experiments. OpenGL rather makes my non-maths brain hurt so I've settled for various pseudo 3d projections. Oddly I had never used the Isometric projection so I decided to dust down some old JS code and rewrite it in Dart with a new look.

The live demo is here and the code is on github. There's few things I would like to do to this such as add more palettes, more controls so you can sculpt the landscape to your liking.

A game would be fun to write - a little clone of Q-bert (another 8-bit favourite of mine!