use of boofcv.gui.d3.ColorPoint3D in project narchy by automenta.
the class ExampleStereoTwoViewsOneCamera method main.
public static void main(String[] args) throws InterruptedException {
ExampleStereoTwoViewsOneCamera e = new ExampleStereoTwoViewsOneCamera();
new SpaceGraphPhys3D(new SimpleSpatial(e) {
@Override
public void renderAbsolute(GL2 gl, int dtMS) {
for (ColorPoint3D p : e.gui.view.cloud) {
int cc = p.rgb;
gl.glColor3f(Bitmap2D.decodeRed(cc), Bitmap2D.decodeGreen(cc), Bitmap2D.decodeBlue(cc));
Draw.rect(gl, (float) p.x, (float) p.y, 1, 1, (float) p.z);
}
}
}).show(800, 800);
RayTracer r = RayTracer.raytracer();
r.update();
r.renderProgressively();
r.scene.camera.position.x = 4 - 1;
// r.scene.camera.direction.x = -0.577 + 0.25f;
r.update();
r.renderProgressively();
e.snap(r.image);
Thread.sleep(200);
// new Thread(()->{
double t = 0;
// while (true) {
r.scene.camera.position.x = 4 + 1;
// r.scene.camera.direction.x = -0.577 - 0.25f;
r.update();
if (r.renderProgressively()) {
r.input.waitForInput();
}
// r.scene.camera.position.x += Math.cos(t)*0.2f;
t += 0.2f;
// }
// }).start();
// new Thread(()->{
// while (true) {
e.snap(r.image);
try {
Thread.sleep(250);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
// }
//
// }).start();
}
Aggregations