Turtle 4D

As a child of the 80s I fondly recall learning to program in Logo.  This was a simple language that allowed you to instruct a turtle to draw pictures.  You could give it instructions such as move forward 50 spaces, turn 60 degrees, move forward 50 spaces and repeat 4 times more and it would end of drawing a hexagon.  You could create all kinds of interesting patterns and it was a great first intro to programming for kids I think.

I decided to extend this into 3 dimensions and then ultimately into 4 dimensions and wrote software that allows you to instruct a turtle how to translate and rotate in relative 4d space.  You can watch the drawing where the 4th dimension is reflected as the animation of the 3d hyperplanes.

Here is a random example of the code where the turtle is doing loopdy-loops then turning then a little to the side and doing another until a whole ball is drawn and then dipping 45 degrees in the local Y/Time plane and doing it again.

For i = 1 To 360 / 45

For i1 = 1 To 180 / 5

For i2 = 1 To 36

t.rotate(Turtle4D.RotationType.PitchUp, 5 * Math.PI / 180)

t.move(25, True, Color.Red)

t.rotate(Turtle4D.RotationType.PitchUp, 5 * Math.PI / 180)

Next

t.rotate(Turtle4D.RotationType.YawRight, 5 * Math.PI / 180)

Next

t.rotate(Turtle4D.RotationType.TimeYPlus, 45 * Math.PI / 180)

Next

And here is a video of the result:

The colors indicate the direction of travel through time but I would need to study the code a bit more to explain how, I believe my methodology was to plot the 4d movement and then slice it up by time and store segments of the lines between T-delta/2 and T+delta/2 coloring the start and end of any line in that span of time with the node in the past in red and the node in the future in blue (and green if they are at the same T) and then blending the color over the length of the line.

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.