/* create spheres */
Primitive p;
- int nx = 4; // 6
- int ny = 4; // 6
- int nz = 4; // 6
+ int nx = 6; // 4
+ int ny = 6; // 4
+ int nz = 6; // 4
for (int i = 0; i < nx; i++) {
for (int j = 0; j < ny; j++) {
for (int k = 0; k < nz; k++) {
row[x]= alpha | (red << 16) | (green << 8) | (blue);
} // end for (x)
- image[y-interval.yfrom]=row;
+ image[y]=row;
} // end for (y)
public TestRunner(int id,
int numCore,
int size,
+ int image[][],
Scene scene) {
super();
this.id = id;
this.numCore = numCore;
this.size = size;
-
+ this.image=image;
// create the objects to be rendered
this.scene = scene; //createScene();
}
public void init() {
- this.image=new int[this.size/this.numCore][];
+
}
public void JGFvalidate() {
Composer comp = new Composer(threadnum, size);
RayTracer rt = new RayTracer();
Scene scene = rt.createScene();
- for(int i = 0; i < threadnum; ++i) {
- TestRunner tr = new TestRunner(i, threadnum, size, scene);
+ int image[][]=new int[size][];
+ TestRunner trarray[]=new TestRunner[threadnum];
+ for(int i = 1; i < threadnum; ++i) {
+ TestRunner tr = new TestRunner(i, threadnum, size, image, scene);
tr.start();
- }
- }
+ trarray[i]=tr;
+ }
+ TestRunner tr0 = new TestRunner(0, threadnum, size, image, scene);
+ tr0.run();
+ for(int i = 1; i < threadnum; ++i) {
+ trarray[i].join();
+ }
+}
}