#include <stdio.h>
#include <iostream>
static void
{
std::cerr << "Usage: " << program << "\n";
}
static inline float
sphereVal(
int i,
int j,
int k,
int xres,
int yres,
int zres)
{
x = 2.0F * (i-0.5F*xres+0.5F) / xres;
y = 2.0F * (j-0.5F*yres+0.5F) / yres;
z = 2.0F * (k-0.5F*zres+0.5F) / zres;
return SYSsqrt(x*x + y*y + z*z) < 1.0F ? 1.0F : 0;
}
int
{
const int xres = 16;
const int yres = 16;
const int zres = 16;
{
return 1;
}
{
handle->size(xres, yres, zres);
for (i = 0; i < xres; i++)
for (j = 0; j < yres; j++)
for (k = 0; k < zres; k++)
handle->setValue(i, j, k,
sphereVal(i, j, k, xres, yres, zres));
}
gdp.
save(std::cout, binary, NULL);
return 0;
}