Makedata_KP/0000700013267501326700000000000010367661210012157 5ustar toelkecgipMakedata_KP/README0000600013267501326700000000245210367661106013050 0ustar toelkecgipKummer_Perlin, automatic volume data set production. Written by Jrgen Toelke. Files included in this package: Kummer_Perlin.c characterizes the function of the Kummer surface with Perlin noise. MakeVolume3D.c contains the main() function. Nevertheless, the program is compiled as Kummer_Perlin. The purpose of this is the possibility to copy and rewrite the function in Kummer_Perlin.c, getting other functions to store. PERLIN.c contains the method producing Perlin noise. This part is not from me, but directly copied from the program of Ken Perlin, reduced to the necessary functions for 3D-noise. Kummer_Perlin.gif An small example picture of the dataset, produced by the isosurface extraction program. The program can be compiled by: cc Kummer_Perlin.c -lm -o Kummer_Perlin and then called by Kummer_Perlin N N defines the size of the data set, which will contain NxNxN voxels or 2*N*N*N byte. For example, 'Kummer_Perlin 128' produces a data set of 4 Megabyte. The Kummer function is defined as: f_K(x,y,z)=(x^2+y^2+z^2-2)^2+ 5*(1-z-x*sqrt(2))*(1-z+x*sqrt(2))*(1+z+y*sqrt(2))*(1+z-y*sqrt(2)) To build this volume dataset, the Kummer function ist calculated within the range [-10,10]^3, and a Perlin noise function f_P is added by the formula f(x,y,z)=f_K(x,y,z)+1/15*f_P(x,y,z) Makedata_KP/MakeVolume3D.c0000600013267501326700000000227210364731554014572 0ustar toelkecgip#include #define MAX_INTENSITY 65535 void WriteShort(FILE* filestruct,unsigned short k) { fputc(k%256,filestruct); fputc(k/256,filestruct); } int main(ac,av) int ac; char* av[]; { int size=50; float vmin=0,vmax=0; unsigned short vval; int xi,yi,zi; float x,y,z; char Savefile[256]; FILE* fst; if (ac>1) size=atoi(av[1]); if (size>1290) { puts("Error: Array too big"); exit(0); }; sprintf(Savefile,"ARRAY_%s_%i",av[0],size); fst=fopen(Savefile,"w"); if (fst==0) { puts("Error: File could not be opened"); exit(0); }; /* Checkbyte */ fputc(0,fst); /* Dimension */ fputc(3,fst); /* Format of data */ WriteShort(fst,size); WriteShort(fst,size); WriteShort(fst,size); /* generating data */ for (zi=0;zivmax) vmax=vval; if (vval #include static int p[P_B + P_B + 2]; static double g3[P_B + P_B + 2][3]; static int start = 1; void normalize3(double v[3]); void init(void); double noise3(double vec[3]) { int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; double rx0, rx1, ry0, ry1, rz0, rz1, *q, sy, sz, a, b, c, d, t, u, v; int i, j; if (start) { start = 0; init(); } setup(0, bx0,bx1, rx0,rx1); setup(1, by0,by1, ry0,ry1); setup(2, bz0,bz1, rz0,rz1); i = p[ bx0 ]; j = p[ bx1 ]; b00 = p[ i + by0 ]; b10 = p[ j + by0 ]; b01 = p[ i + by1 ]; b11 = p[ j + by1 ]; t = s_curve(rx0); sy = s_curve(ry0); sz = s_curve(rz0); q = g3[ b00 + bz0 ] ; u = at3(rx0,ry0,rz0); q = g3[ b10 + bz0 ] ; v = at3(rx1,ry0,rz0); a = lerp(t, u, v); q = g3[ b01 + bz0 ] ; u = at3(rx0,ry1,rz0); q = g3[ b11 + bz0 ] ; v = at3(rx1,ry1,rz0); b = lerp(t, u, v); c = lerp(sy, a, b); q = g3[ b00 + bz1 ] ; u = at3(rx0,ry0,rz1); q = g3[ b10 + bz1 ] ; v = at3(rx1,ry0,rz1); a = lerp(t, u, v); q = g3[ b01 + bz1 ] ; u = at3(rx0,ry1,rz1); q = g3[ b11 + bz1 ] ; v = at3(rx1,ry1,rz1); b = lerp(t, u, v); d = lerp(sy, a, b); return lerp(sz, c, d); } void normalize3(double v[3]) { double s; s = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); v[0] = v[0] / s; v[1] = v[1] / s; v[2] = v[2] / s; } void init(void) { int i, j, k; for (i = 0 ; i < P_B ; i++) { p[i] = i; for (j = 0 ; j < 3 ; j++) g3[i][j] = (double)((random() % (P_B + P_B)) - P_B) / P_B; normalize3(g3[i]); } while (--i) { k = p[i]; p[i] = p[j = random() % P_B]; p[j] = k; } for (i = 0 ; i < P_B + 2 ; i++) { p[P_B + i] = p[i]; for (j = 0 ; j < 3 ; j++) g3[P_B + i][j] = g3[i][j]; } } /* --- My harmonic summing functions - PDB --------------------------*/ /* In what follows "alpha" is the weight when the sum is formed. Typically it is 2, As this approaches 1 the function is noisier. "beta" is the harmonic scaling/spacing, typically 2. */ double PerlinNoise3D(double x,double y,double z,double alpha,double beta,int n) { int i; double val,sum = 0; double p[3],scale = 1; p[0] = x; p[1] = y; p[2] = z; for (i=0;i #include "PERLIN.c" float UserFunc(x,y,z) float x,y,z; { float q2,v2,p,q,r,s,f1,f2,al,xs,ys,zs,ppn,result; q2=sqrtf(2.0); v2=2.0; al=10.0; xs=x*al; ys=y*al; zs=z*al; p=1.0-zs-xs*q2; q=1.0-zs+xs*q2; r=1.0+zs+ys*q2; s=1.0+zs-ys*q2; f1=(xs*xs+ys*ys+zs*zs-v2); f1=(3.0-v2)*f1*f1; f2=(3.0*v2-1.0)*p*q*r*s; ppn=PerlinNoise3D(x,y,z,2,2,10); result=(f1+f2+36043)/273252+ppn/15; if (result<0) result=0; if (result>1) result=1; return(result); } #include "MakeVolume3D.c" Makedata_KP/Kummer_Perlin.gif0000600013267501326700000002545110364732151015430 0ustar toelkecgipGIF87a M WHQD(D JRX\e጖HMIiQVE2OgI'':ŒܬT&2<+fF)\wЈ ZuU .K'P2H$+#٣.e# Nͅ3I,<Y03 vOlhWO.3P'*`!8jD)-IR4L:\h_gDV.Q*[{$rOw6,H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϟ@ JѣH*]ʴӧPJJիXjʵׯ`ÊKٳhӪ]˶۷pʝKݻx˷߿ LÈ&Y$1[7vX2)U$2̚ꩡr$zZ#i=ztLǧ]#yFٞ |$MnRj쎣@s:t G]܉WIݼytÇKKpT)JH~[v>T)R"[ l}95G4 x`I'bzl' )Ҍc`1FNN=7. b!guV4NHa1(Q=ԃc:a%+)! Ud(#/PPXXނ@BGH҇fX&0"$ġ6@ ggJZF@'5ԀB{9( Ũ[|q(Qyƣ(IgPq逤xN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