davidedc / livecodelab

a web based livecoding environment
http://livecodelab.net/
MIT License
327 stars 63 forks source link

Turtle-graphics extensions #250

Open davidedc opened 9 years ago

davidedc commented 9 years ago

Preamble:

I'm going to add a couple of keywords like penUp and penDown and showTurtle and hideTurtle, forward, backward, turnRight, turnLeft (both in degrees), arc.

I'm also gonna add an "axes" keyword which is gonna draw the axes according to the world matrix when "axes" is called.

This spawned out of a maddening "what the heck should be the order of the transformations here" moment, where I realised that drawing the axes would make everything so much easier to understand... and finally realising what several tweets have pointed out already, that LCL can also be used as a 3d version of Logo...

If that can be done with a few new keywords then it'd look like a win...

If the mapping is as direct as it looks at first sight then I'm gonna try to flesh it out tonight...

(Let's see how it pans out, we can scrap if we don't like.)

rumblesan commented 9 years ago

this sounds like it could be hilarious haha. I'm all for it

davidedc commented 9 years ago

I've pushed it in dedicated branch and published in secret directory here:

http://livecodelab.net/play2.1/

Some examples:

I didn't add the penUp / penDown yet, and there are a couple of tweaks and questions...

There is an "axes" command not shown in the examples that draws the axes (with the world transformations applied when invoked)

...play around with it as you please, pass over interesting stuff or examples that you find or comments...

davidedc commented 9 years ago

:turtle: :turtle: :turtle: :turtle: screen shot 2015-06-21 at 11 11 36 screen shot 2015-06-21 at 11 12 16

rumblesan commented 9 years ago

hahaha, so this is really cool. will start having a play around

rumblesan commented 9 years ago

just a quick one, I think that axes command would be really useful in general. especially when teaching people

davidedc commented 9 years ago

indeed, that's how the rabbit hole started. I needed to see the axes, and then really one can see them as the current "cursor", or "pen" or "turtle"...

davidedc commented 9 years ago

:turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: :turtle: screen shot 2015-06-21 at 12 49 10

rumblesan commented 9 years ago

hey, so I've rebased the changes you made for the turtle onto the new master branch and pushed it as a new branch. There were a couple of minor things I've fixed up but it seems to be working. Though I couldn't get it to actually draw the turtle, just a red line.

davidedc commented 9 years ago

ops might not have pushed the "turtle" change yet.

I'm concerned with the turtle being too cutesy for LCL. So I thought maybe, in addition to showTurtle/hideTurtle, there should be a showPen/hidePen.

because of the penUp/penDown keywords people would normally show the pen (it would look like an arrow I think), but the cutesy-inspired could show the turtle instead...