41 std::cerr <<
"Usage: " << program <<
"\n";
45 sphereVal(
int i,
int j,
int k,
int xres,
int yres,
int zres)
49 x = 2.0F * (i-0.5F*xres+0.5F) / xres;
50 y = 2.0F * (j-0.5F*yres+0.5F) / yres;
51 z = 2.0F * (k-0.5F*zres+0.5F) / zres;
52 return SYSsqrt(x*x + y*y + z*z) < 1.0F ? 1.0F : 0;
89 handle->size(xres, yres, zres);
90 for (i = 0; i < xres; i++)
91 for (j = 0; j < yres; j++)
92 for (k = 0; k < zres; k++)
93 handle->setValue(i, j, k,
94 sphereVal(i, j, k, xres, yres, zres));
98 gdp.
save(std::cout, binary, NULL);
const GLuint GLenum const void * binary
GLdouble GLdouble GLdouble z
IOStatus save(const char *filename, const GA_SaveOptions *options, UT_StringArray *errors=0) const
static GEO_PrimVolume * build(GU_Detail *gdp, bool integers=false, int comps=1)
GLsizeiptr const void GLenum usage
int theMain(int argc, char *argv[])
**If you just want to fire and args
UT_VoxelArrayWriteHandleF getVoxelWriteHandle()
This is a handle that you can write to and affect the volume.
void initialize(int argc, const char *const argv[])
GLbitfield GLuint program