39 std::cerr <<
"Usage: " << program <<
"\n";
43 sphereVal(
int i,
int j,
int k,
int xres,
int yres,
int zres)
47 x = 2.0F * (i-0.5F*xres+0.5F) / xres;
48 y = 2.0F * (j-0.5F*yres+0.5F) / yres;
49 z = 2.0F * (k-0.5F*zres+0.5F) / zres;
50 return SYSsqrt(x*x + y*y + z*z) < 1.0F ? 1.0F : 0;
62 main(
int argc,
char *argv[])
87 handle->size(xres, yres, zres);
88 for (i = 0; i < xres; i++)
89 for (j = 0; j < yres; j++)
90 for (k = 0; k < zres; k++)
91 handle->setValue(i, j, k,
92 sphereVal(i, j, k, xres, yres, zres));
96 gdp.
save(std::cout, binary, NULL);
int main(int argc, char *argv[])
static GEO_PrimVolume * build(GU_Detail *gdp)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
const GLuint GLenum const void * binary
GLsizeiptr const void GLenum usage
IOStatus save(const char *filename, const GA_SaveOptions *options, UT_StringArray *errors=0) const
UT_VoxelArrayWriteHandleF getVoxelWriteHandle()
This is a handle that you can write to and affect the volume.
void initialize(int argc, const char *const argv[])