0x726048362412y726048362412
Grid:
Tics Lines:
Width px
Hash Lines:
Width px
Labels:
Font px
Trace Lines:
Robot 1:
Width px
Robot 2:
Width px
Robot 3:
Width px
Robot 4:
Width px
Axes: x-axis y-axis Show Grid
Grid: 24x24 inches 36x36 inches 72x72 inches
96x96 inches 192x192 inches
Quad: 4 quadrants 1 quadrant
Units: US Customary Metric
Background:

Robot 1

Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (0 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 2

Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (12 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 3

Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (24 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 4

Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (36 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Animate a 3D Cube and Triangles
Problem Statement:
In 3D graphics, more complex shapes are usually created using triangles. A triangle is a simple polygon and the vertices of a triangle will always be co-planar. Other objects can be split into triangles, so using triangles to create complex objects is an efficient method. The pre-placed blocks draw a cube with 6 triangles in 3 different shades of blue. Add a loop to animate the triangles moving away from the center and another to animate them moving back into a cube.
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
double i;
CPlot plot;

plot.noStrokeColor();
for(i = 0; i <= 10; i++) {
  plot.backgroundColor("black");
  plot.fillColor("#33ccff");
  plot.triangle(36 - i * 1.5, 36, 24 - i * 1.5, 42, 24 - i * 1.5, 24);
  plot.triangle(36 - i, 36, 36 - i, 18, 24 - i, 24);
  plot.fillColor("#3366ff");
  plot.triangle(36, 36 + i, 24, 42 + i, 48, 42 + i);
  plot.triangle(36, 48 + i * 1.5, 24, 42 + i * 1.5, 48, 42 + i * 1.5);
  plot.fillColor("#3333ff");
  plot.triangle(36 + i * 1.5, 36, 48 + i * 1.5, 42, 48 + i * 1.5, 24);
  plot.triangle(36 + i, 36, 36 + i, 18, 48 + i, 24);
  delaySeconds(0.03);
}
for(i = 10; i >= 0; i--) {
  plot.backgroundColor("black");
  plot.fillColor("#33ccff");
  plot.triangle(36 - i * 1.5, 36, 24 - i * 1.5, 42, 24 - i * 1.5, 24);
  plot.triangle(36 - i, 36, 36 - i, 18, 24 - i, 24);
  plot.fillColor("#3366ff");
  plot.triangle(36, 36 + i, 24, 42 + i, 48, 42 + i);
  plot.triangle(36, 48 + i * 1.5, 24, 42 + i * 1.5, 48, 42 + i * 1.5);
  plot.fillColor("#3333ff");
  plot.triangle(36 + i * 1.5, 36, 48 + i * 1.5, 42, 48 + i * 1.5, 24);
  plot.triangle(36 + i, 36, 36 + i, 18, 48 + i, 24);
  delaySeconds(0.03);
}

plot.axisRange(PLOT_AXIS_XY, 0, 72);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
Blocks Save Blocks Load Blocks Show Ch Save Ch Workspace
Problem Statement:
In 3D graphics, more complex shapes are usually created using triangles. A triangle is a simple polygon and the vertices of a triangle will always be co-planar. Other objects can be split into triangles, so using triangles to create complex objects is an efficient method. The pre-placed blocks draw a cube with 6 triangles in 3 different shades of blue. Add a loop to animate the triangles moving away from the center and another to animate them moving back into a cube.

		
Time