projects
/
sixth-3d-demos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed ViewContext.
[sixth-3d-demos.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
sixth
/
e3d
/
examples
/
OctreeDemo.java
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
index
0865ee7
..
5e5e15f
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
@@
-9,8
+9,8
@@
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.g
eometry.Transform
;
-import eu.svjatoslav.sixth.e3d.
gui.ViewContext
;
+import eu.svjatoslav.sixth.e3d.g
ui.ViewPanel
;
+import eu.svjatoslav.sixth.e3d.
math.Transform
;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
import eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationTracker;
import eu.svjatoslav.sixth.e3d.renderer.octree.OctreeVolume;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
import eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationTracker;
import eu.svjatoslav.sixth.e3d.renderer.octree.OctreeVolume;
@@
-37,7
+37,7
@@
public class OctreeDemo extends WorldNavigationTracker {
private final Vector<LightSource> lights = new Vector<>();
private OctreeVolume octreeVolume;
private ShapeCollection shapeCollection;
private final Vector<LightSource> lights = new Vector<>();
private OctreeVolume octreeVolume;
private ShapeCollection shapeCollection;
- private View
Context context
;
+ private View
Panel viewPanel
;
public static void main(final String[] args) {
new OctreeDemo().init();
public static void main(final String[] args) {
new OctreeDemo().init();
@@
-90,13
+90,13
@@
public class OctreeDemo extends WorldNavigationTracker {
private void init() {
final ViewFrame viewFrame = new ViewFrame();
private void init() {
final ViewFrame viewFrame = new ViewFrame();
-
context = viewFrame.getView().getContext
();
+
viewPanel = viewFrame.getViewPanel
();
-
context
.getAvatar().setLocation(new Point3D(0, -30, -300));
+
viewPanel
.getAvatar().setLocation(new Point3D(0, -30, -300));
octreeVolume = new OctreeVolume();
octreeVolume = new OctreeVolume();
- shapeCollection =
context
.getRootShapeCollection();
+ shapeCollection =
viewPanel
.getRootShapeCollection();
shapeCollection.addShape(new Grid3D(
new Point3D(-10000, -10000, -10000), new Point3D(10000, 10000,
shapeCollection.addShape(new Grid3D(
new Point3D(-10000, -10000, -10000), new Point3D(10000, 10000,
@@
-124,18
+124,18
@@
public class OctreeDemo extends WorldNavigationTracker {
Color.WHITE, Color.PURPLE);
shapeCollection.addShape(message);
Color.WHITE, Color.PURPLE);
shapeCollection.addShape(message);
-
context
.getKeyboardFocusTracker().setFocusOwner(this);
-
context.getView()
.repaintDuringNextViewUpdate();
+
viewPanel
.getKeyboardFocusTracker().setFocusOwner(this);
+
viewPanel
.repaintDuringNextViewUpdate();
}
@Override
}
@Override
- public void keyPressed(final KeyEvent event, final View
Context viewContext
) {
+ public void keyPressed(final KeyEvent event, final View
Panel viewPanel
) {
if ('r' == event.getKeyChar()) {
raytrace();
return;
}
if ('r' == event.getKeyChar()) {
raytrace();
return;
}
- super.keyPressed(event, view
Context
);
+ super.keyPressed(event, view
Panel
);
}
private void putPixel(final int x, final int y, final int z,
}
private void putPixel(final int x, final int y, final int z,
@@
-159,12
+159,12
@@
public class OctreeDemo extends WorldNavigationTracker {
private void raytrace() {
// create and add camera object to scene
private void raytrace() {
// create and add camera object to scene
- final Camera camera = new Camera(
context
.getAvatar(), magnification);
+ final Camera camera = new Camera(
viewPanel
.getAvatar(), magnification);
shapeCollection.addShape(camera);
// initialize and start Raytracer in a separate thread
final RayTracer rayTracer = new RayTracer(camera.getTexture(),
shapeCollection.addShape(camera);
// initialize and start Raytracer in a separate thread
final RayTracer rayTracer = new RayTracer(camera.getTexture(),
- octreeVolume, lights, camera,
context.getView()
);
+ octreeVolume, lights, camera,
viewPanel
);
final Thread thread = new Thread(rayTracer);
thread.start();
}
final Thread thread = new Thread(rayTracer);
thread.start();
}