- if (!_fenceMode)
- {
- // connect the points
- _model->segment(_diameter,
- startX, startY, startZ,
- endX, endY, endZ);
- }
- else
- {
- // part of a filled surface
- _model->point(endX, endY, endZ);
- }
+ // connect start and end point
+ _model->segment(startX, startY, startZ,
+ endX, endY, endZ);
+}
+
+
+
+/**
+ * Walk forward, creating a filled surface
+ * TODO: merge with walk() ?
+ */
+void Turtle::fillWalk()
+{
+ // end point
+ double destinationX = _position.getX() + _heading.getX();
+ double destinationY = _position.getY() + _heading.getY();
+ double destinationZ = _position.getZ() + _heading.getZ();
+
+ _model->normal(_up.getX(), _up.getY(), _up.getZ());
+
+ // move turtle to new position
+ _position.setXYZ(destinationX, destinationY, destinationZ);
+
+ // part of a filled polygon
+ _model->vertex(destinationX, destinationY, destinationZ);