Difference between revisions of "Activities/TurtleBlocks3D"

From Sugar Labs
Jump to navigation Jump to search
m
 
(14 intermediate revisions by 2 users not shown)
Line 5: Line 5:
  
 
==About TurtleBlocks3D==
 
==About TurtleBlocks3D==
Turtle Blocks 3D is an extension of Turtle Blocks into three dimensions. Instead of moving a turtle on a plane, the turtle can be moved in a three-dimensional Cartesian space.
+
Turtle Blocks 3D is an extension of Turtle Blocks into three dimensions. In addition to moving the turtle on a plane, the turtle can be moved in a three-dimensional Cartesian space.
[[Image:Turtle-3d.png | 850px]]
+
 
 +
All of the features from [[Activities/Turtle_Art| Turtle Blocks 2D]] are present in this version, along with some new ones.
 +
 
 +
This activity runs in Sugar and also in the GNOME desktop. To run it from GNOME, you will need to clone the repository and then run the executable <code>turtleblocks-3d.py</code>.
 +
 
 +
[[Image:TurtleBlocks3D-about.png | 850px]]
  
 
==Where to get TurtleBlocks3D==
 
==Where to get TurtleBlocks3D==
 
The TurtleBlocks3D activity is available for download from the [http://activities.sugarlabs.org Sugar Activity Library]: [http://activities.sugarlabs.org/sugar/addon/4757 TurtleBlocks3D]
 
The TurtleBlocks3D activity is available for download from the [http://activities.sugarlabs.org Sugar Activity Library]: [http://activities.sugarlabs.org/sugar/addon/4757 TurtleBlocks3D]
  
The source code is available on [https://github.com/Anubhav-J/turtleart GitHub].
+
The source code is available [https://github.com/walterbender/turtle3D here].
 +
 
 +
==Toolbars==
 +
In this section you will find the description of those toolbar items that are unique features of the 3D version of Turtle Blocks. For information about other toolbar items, please refer to [[Activities/Turtle_Blocks#Toolbars| Turtle Blocks wiki page]].
 +
 
 +
[[Image:TurtleBlocks3D-toolbar-001.png|800px]]
 +
 
 +
You can save the 3D objects you create in TurtleBlocks3D as [https://en.wikipedia.org/wiki/Wavefront_.obj_file .obj files] and you can load .obj files generated from other programs, such as [http://www.blender.org/ Blender].
 +
 
 +
[[Image:TurtleBlocks3D-toolbar-004.png]]
 +
 
 +
;Save as wavefront .obj: Use this button to export 3D graphics to '.obj' format. We currently support points, lines, polygons, and color.
 +
 
 +
[[Image:TurtleBlocks3D-toolbar-005.png]]
 +
 
 +
;Load wavefront.obj: Use this button to import 3D graphics from the .obj file format (used by many 3D modeling tools). When you click the button, a "Choose an object" dialog pops up; from there, select an .obj file from the Sugar Journal or the filesystem.
 +
 
 +
[https://github.com/walterbender/turtle3D/blob/master/samples/turtle.obj Example .obj]
 +
 
 +
[[Image:TurtleBlocks3D-toolbar-002.png]]
 +
 
 +
[[Image:TurtleBlocks3D-toolbar-006.png]]
 +
 
 +
It is 3D, So you can also choose where to look from, With the Camera-position option you can choose top, front, left, right, top-left and top-right camera positions!
 +
 
 +
====Turtle Palette====
 +
[[Image:TurtleBlocks3D-toolbar-003.png|600px]]
 +
 
 +
These blocks are used to control the movements of the turtle.
 +
 
 +
;forward: move turtle forward
 +
;back: move turtle backward
 +
;clean: clear the screen and position the turtle in the center of the screen, pen down, color red, heading 0
 +
;left: rotate turtle counterclockwise
 +
;right: rotate turtle clockwise
 +
;set xyz: set turtle's x,y,z position (0,0,0) is the center of the screen *
 +
;set camera xyz: set camera's x,y,z position *
 +
;set heading: set turtle heading
 +
;set roll: set turtle's roll *
 +
;set pitch: set turtle's pitch *
 +
;xcor: holds current x-coordinate value of the turtle (can be used in place of a number block)
 +
;ycor: holds current y-coordinate value of the turtle (can be used in place of a number block)
 +
;zcor: holds current z-coordinate value of the turtle (can be used in place of a number block) *
 +
;get heading: heading: holds current heading value of the turtle
 +
;get roll: heading: holds current roll value of the turtle (can be used in place of a number block) *
 +
;get pitch: heading: holds current pitch value of the turtle (can be used in place of a number block) *
 +
 
 +
Items marked with * are the options that only exist in Turtle Blocks 3D.
 +
 
 +
==Gallery==
 +
<gallery>
 +
File:TurtleBlocks3D-001.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-tetrahedron.tb Example 1]
 +
File:TurtleBlocks3D-002.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-turtle.tb Example 2]
 +
File:TurtleBlocks3D-003.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-cube.tb Example 3]
 +
File:TurtleBlocks3D-004.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-chessboard.tb Example 4]
 +
File:TurtleBlocks3D-005.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-helix-color.tb Example 5]
 +
File:TurtleBlocks3D-006.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-cubes-aligned.tb Example 6]
 +
File:TurtleBlocks3D-007.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-cubes-random.tb Example 7]
 +
File:TurtleBlocks3D-008.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-spirals.tb Example 8]
 +
File:TurtleBlocks3D-009.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-hex-prism-filled.tb Example 9]
 +
File:TurtleBlocks3D-010.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-hex-prism.tb Example 10]
 +
File:TurtleBlocks3D-011.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-hut.tb Example 11]
 +
File:TurtleBlocks3D-012.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-lamp1.tb Example 12]
 +
File:TurtleBlocks3D-013.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-lamp2.tb Example 13]
 +
File:TurtleBlocks3D-014.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-pyramid-fill.tb Example 14]
 +
File:TurtleBlocks3D-015.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-pyramid.tb Example 15]
 +
File:TurtleBlocks3D-016.png|[https://github.com/walterbender/turtle3D/blob/master/samples/3d-camera-rotation.tb Example 16]
 +
</gallery>
  
 
==Modifying TurtleBlocks3D==
 
==Modifying TurtleBlocks3D==
Line 21: Line 93:
  
 
==Credits==
 
==Credits==
The activity was made by [http://wiki.sugarlabs.org/go/Summer_of_Code/2014/AnubhavJ/Turtle_Art_3D Anubhav Jaiswal] in [http://wiki.sugarlabs.org/go/Summer_of_Code/2014 Google Summer of Code 2014] under the mentor Tony Forster
+
* Walter Bender maintains the code
 +
* The activity was made by [http://wiki.sugarlabs.org/go/Summer_of_Code/2014/AnubhavJ/Turtle_Art_3D Anubhav Jaiswal] in [http://wiki.sugarlabs.org/go/Summer_of_Code/2014 Google Summer of Code 2014] under the mentorship of Tony Forster
 +
 
 +
 
 +
[[Category:Activities]]

Latest revision as of 23:23, 20 April 2016


Turtleart3d-icon.svg

About TurtleBlocks3D

Turtle Blocks 3D is an extension of Turtle Blocks into three dimensions. In addition to moving the turtle on a plane, the turtle can be moved in a three-dimensional Cartesian space.

All of the features from Turtle Blocks 2D are present in this version, along with some new ones.

This activity runs in Sugar and also in the GNOME desktop. To run it from GNOME, you will need to clone the repository and then run the executable turtleblocks-3d.py.

TurtleBlocks3D-about.png

Where to get TurtleBlocks3D

The TurtleBlocks3D activity is available for download from the Sugar Activity Library: TurtleBlocks3D

The source code is available here.

Toolbars

In this section you will find the description of those toolbar items that are unique features of the 3D version of Turtle Blocks. For information about other toolbar items, please refer to Turtle Blocks wiki page.

TurtleBlocks3D-toolbar-001.png

You can save the 3D objects you create in TurtleBlocks3D as .obj files and you can load .obj files generated from other programs, such as Blender.

TurtleBlocks3D-toolbar-004.png

Save as wavefront .obj
Use this button to export 3D graphics to '.obj' format. We currently support points, lines, polygons, and color.

TurtleBlocks3D-toolbar-005.png

Load wavefront.obj
Use this button to import 3D graphics from the .obj file format (used by many 3D modeling tools). When you click the button, a "Choose an object" dialog pops up; from there, select an .obj file from the Sugar Journal or the filesystem.

Example .obj

TurtleBlocks3D-toolbar-002.png

TurtleBlocks3D-toolbar-006.png

It is 3D, So you can also choose where to look from, With the Camera-position option you can choose top, front, left, right, top-left and top-right camera positions!

Turtle Palette

TurtleBlocks3D-toolbar-003.png

These blocks are used to control the movements of the turtle.

forward
move turtle forward
back
move turtle backward
clean
clear the screen and position the turtle in the center of the screen, pen down, color red, heading 0
left
rotate turtle counterclockwise
right
rotate turtle clockwise
set xyz
set turtle's x,y,z position (0,0,0) is the center of the screen *
set camera xyz
set camera's x,y,z position *
set heading
set turtle heading
set roll
set turtle's roll *
set pitch
set turtle's pitch *
xcor
holds current x-coordinate value of the turtle (can be used in place of a number block)
ycor
holds current y-coordinate value of the turtle (can be used in place of a number block)
zcor
holds current z-coordinate value of the turtle (can be used in place of a number block) *
get heading
heading: holds current heading value of the turtle
get roll
heading: holds current roll value of the turtle (can be used in place of a number block) *
get pitch
heading: holds current pitch value of the turtle (can be used in place of a number block) *

Items marked with * are the options that only exist in Turtle Blocks 3D.

Gallery

Modifying TurtleBlocks3D

  • We plan to add texture mapping.
  • Rewrite a JS Version of the activity

Support

Support for this activity is provided by the developer at walter@sugarlabs.org

Credits