View 3D

- perspective drawing in 3D space


These programs use perspective mode to allow the turtle to move in 3D space. This adds a depth Z value to the normal 2D X and Y values.

Building shapes in 3D is not as easy as 2D. The turtle can roll and pitch, so there are often several different ways of drawing a given shape.

A 2D square has 4 edges and 4 corners. In 3D a cube has 6 faces, 8 corners and 12 edges.

Entering View 3D displays the lines, points and surfaces in fully rotateable 3D. Lights and fog can be added.

Note: Type in the command CS View3D to clear the View3D window and prevent too many shapes building up.

See perspective primitives.

Cube Octahedron
Wire frame and balls cube octahedon.

Colored dice, correctly labelled.

Face Cube
Cube face 'parasols' recursion.

Knight's Tour
Cube 4x4x4 array knight's tour.

Mobius Band
Twisted paper loop.

Platonic Solid
All 5 regular platonic solids.

XYZ Axis
Demo of XYZ relative and absolute positions.

One Liners

You need to be in Perspective mode (type in 3D).

Copy and paste any one line of code into the XLogo command line and press <Enter> key to run. Widen the XLogo window to easily see and edit a long instruction.

You may need to first type in CS to clear the screen. You can change the default pen and screen color by selecting Tools / Preferences / Options from the XLogo menu.

To slow down the drawing speed add in your own Wait commands.

Try and work out the image each code will produce before you run it...

  1. Repeat 15 [Repeat 4 [Forward 220 Right 90] RightRoll 24]

Also see 2D one liners.

Face Cube
Face Cube


Face Cube
One Liner