@@ 703,6 703,20 @@ createprism(Scene *s, double radius, int segs, double depth, int color)
}
Mesh *
+createsphere(Scene *s, double radius, double segs, double ssegs, int color)
+{
+ double i;
+ Mesh *m = addmesh(s);
+ for(i = 0; i < segs; i++) {
+ double j = i - segs / 2;
+ addshape(m, sqrt(radius * radius - j * j), ssegs, color);
+ moveto(s, 0, 0, i + 1 - segs / 2);
+ }
+ reset(s);
+ return m;
+}
+
+Mesh *
createplane(Scene *s, double width, double height, double xsegs, double ysegs, int color)
{
int ix, iy;