From 377d7b953202100308373b599bfb7254e2c91b1a Mon Sep 17 00:00:00 2001 From: Jean Pierre Charalambos Date: Sun, 13 Jan 2019 20:46:52 -0500 Subject: [PATCH] Shape has gone! --- resources/code/ExampleTaglet.java | 2 +- src/frames/core/Frame.java | 38 ++- src/frames/core/Graph.java | 15 +- src/frames/processing/Scene.java | 137 ++++++++--- src/frames/processing/Shape.java | 223 ------------------ testing/src/intellij/AdaptivePrecision1.java | 14 +- testing/src/intellij/AdaptivePrecision2.java | 11 +- testing/src/intellij/AdaptivePrecision3.java | 13 +- testing/src/intellij/ApplicationControl1.java | 7 +- testing/src/intellij/ApplicationControl2.java | 7 +- testing/src/intellij/ApplicationControl3.java | 8 +- testing/src/intellij/Basics.java | 5 +- testing/src/intellij/DOF.java | 10 +- testing/src/intellij/FrameInterpolation.java | 5 +- testing/src/intellij/Interaction2D.java | 9 +- testing/src/intellij/MiniMap.java | 11 +- testing/src/intellij/MiniMap2.java | 15 +- .../src/intellij/MouseDragInteraction.java | 6 +- .../src/intellij/MouseMoveInteraction.java | 6 +- testing/src/intellij/OFFScreen.java | 8 +- testing/src/intellij/Orbit.java | 10 +- testing/src/intellij/SceneBuffers.java | 8 +- .../src/intellij/ShadowMapDOFOffScreen.java | 10 +- .../src/intellij/ShadowMapDOFOnScreen.java | 10 +- .../src/intellij/ShadowMapDepthOnScreen.java | 10 +- testing/src/intellij/ShadowMapOnScreen.java | 12 +- testing/src/intellij/ShadowMapping.java | 12 +- testing/src/intellij/ShiftViewers.java | 11 +- testing/src/intellij/SpaceNavigator.java | 8 +- web/index.html | 6 +- 30 files changed, 269 insertions(+), 378 deletions(-) delete mode 100644 src/frames/processing/Shape.java diff --git a/resources/code/ExampleTaglet.java b/resources/code/ExampleTaglet.java index 11a1cac3..f6a183ef 100644 --- a/resources/code/ExampleTaglet.java +++ b/resources/code/ExampleTaglet.java @@ -191,7 +191,7 @@ String createHTML(String theString) { "dd.style.display = toOpen? 'block':''; dt.getElementsByTagName('span')[0].innerHTML = toOpen? '-':'+' ; }\n" + "-->\n"; - return dd+"\n
" + + return dd+"\n
" + "
+Example
" + "
"+theString+"
" + "
"; diff --git a/src/frames/core/Frame.java b/src/frames/core/Frame.java index e1e83812..53b68de1 100644 --- a/src/frames/core/Frame.java +++ b/src/frames/core/Frame.java @@ -475,13 +475,17 @@ public void reset() { setScaling(1); } - // id + // colorID + + public int id() { + return _id; + } /** * Uniquely identifies the frame. Also the color to be used for picking with a color buffer. * See: http://stackoverflow.com/questions/2262100/rgb-int-to-rgb-python */ - public int id() { + public int colorID() { return (255 << 24) | ((_id & 255) << 16) | (((_id >> 8) & 255) << 8) | (_id >> 16) & 255; } @@ -2331,7 +2335,7 @@ public Highlighting highlighting() { * @see #backShape(Object) * @see #shape(Object) */ - protected void graphics(Object context) { + public void graphics(Object context) { } /** @@ -2341,7 +2345,7 @@ protected void graphics(Object context) { * @see #graphics(Object) * @see #shape(Object) */ - protected void frontGraphics(Object context) { + public void frontGraphics(Object context) { } /** @@ -2351,7 +2355,7 @@ protected void frontGraphics(Object context) { * @see #graphics(Object) * @see #shape(Object) */ - protected void backGraphics(Object context) { + public void backGraphics(Object context) { } /** @@ -2388,6 +2392,14 @@ public void backShape(Object shape) { _backShape = shape; } + public Object frontShape() { + return _frontShape; + } + + public Object backShape() { + return _backShape; + } + // Java version of the rendering methods /** @@ -2400,7 +2412,7 @@ public void backShape(Object shape) { * @see #backGraphics(processing.core.PGraphics) * @see #shape(processing.core.PShape) */ - protected void graphics(processing.core.PGraphics pGraphics) { + public void graphics(processing.core.PGraphics pGraphics) { } /** @@ -2410,7 +2422,7 @@ protected void graphics(processing.core.PGraphics pGraphics) { * @see #graphics(processing.core.PGraphics) * @see #shape(processing.core.PShape) */ - protected void frontGraphics(processing.core.PGraphics pGraphics) { + public void frontGraphics(processing.core.PGraphics pGraphics) { } /** @@ -2420,7 +2432,7 @@ protected void frontGraphics(processing.core.PGraphics pGraphics) { * @see #graphics(processing.core.PGraphics) * @see #shape(processing.core.PShape) */ - protected void backGraphics(processing.core.PGraphics pGraphics) { + public void backGraphics(processing.core.PGraphics pGraphics) { } /** @@ -2456,4 +2468,14 @@ public void frontShape(processing.core.PShape pshape) { public void backShape(processing.core.PShape pshape) { _backShape = pshape; } + + /* + public processing.core.PShape frontShape() { + return (processing.core.PShape)_frontShape; + } + + public processing.core.PShape backShape() { + return (processing.core.PShape)_backShape; + } + */ } diff --git a/src/frames/core/Graph.java b/src/frames/core/Graph.java index b6645f81..cff3836f 100644 --- a/src/frames/core/Graph.java +++ b/src/frames/core/Graph.java @@ -2824,17 +2824,22 @@ protected void _draw(MatrixHandler matrixHandler, Object context, Frame frame) { matrixHandler.pushModelView(); _applyTransformation(matrixHandler, frame, is2D()); _track(frame); - _render(context, frame); + if (context == backBuffer()) + _drawBackBuffer(context, frame); + else + _draw(context, frame); if (!frame.isCulled()) for (Frame child : frame.children()) _draw(matrixHandler, context, child); matrixHandler.popModelView(); } - protected void _render(Object context, Frame frame) { - // TODO discard condition & focus on testing culling on the back buffer - //if (context != backBuffer() || frame instanceof Shape) - frame.draw(context); + protected void _draw(Object context, Frame frame) { + + } + + protected void _drawBackBuffer(Object context, Frame frame) { + } /** diff --git a/src/frames/processing/Scene.java b/src/frames/processing/Scene.java index 40e70ac5..7e796805 100644 --- a/src/frames/processing/Scene.java +++ b/src/frames/processing/Scene.java @@ -64,33 +64,6 @@ * } * * In this case, the scene {@link #frontBuffer()} corresponds to the {@code canvas}. - *

Shapes

- * A {@link Shape} is a {@link Frame} specialization that can be set from a - * retained-mode rendering Processing {@code PShape} or from an immediate-mode - * rendering Processing procedure. Shapes can be picked precisely using their projection - * onto the screen, see {@link Shape#setPrecision(Frame.Precision)}. Use - * {@link #render()} to render all scene shapes or {@link Shape#draw()} to - * render a specific one instead. - *

Retained-mode shapes

- * To set a retained-mode shape use {@code Shape shape = new Shape(Scene scene, - * PShape shape)} or {@code Shape shape = new Shape(Scene scene)} and then call - * {@link Shape#graphics(PGraphics)}. - *

Immediate-mode shapes

- * To set an immediate-mode shape use code such as the following: - *
- * {@code
- * ...
- * Shape shape;
- * void setup() {
- *   ...
- *   shape = new Shape(scene) {
- *     public void set(PGraphics canvas) {
- *       //immediate-mode rendering procedure
- *     }
- *   };
- * }
- * }
- * 
*

Drawing functionality

* There are several static drawing functions that complements those already provided * by Processing, such as: {@link #drawCylinder(PGraphics, int, float, float)}, @@ -103,7 +76,8 @@ * static ones), such as {@link #beginHUD(PGraphics)}, * {@link #endHUD(PGraphics)}, {@link #drawAxes(PGraphics, float)}, * {@link #drawCross(PGraphics, float, float, float)} and {@link #drawGrid(PGraphics)} - * among others, can be used to set a {@link Shape} (see {@link Shape#graphics(PGraphics)}). + * among others, can be used to set a {@link Frame#shape(PShape)} (see + * also {@link Frame#graphics(PGraphics)}). *

* Another scene's eye (different than this one) can be drawn with * {@link #drawFrustum(Graph)}. Typical usage include interactive minimaps and @@ -1002,10 +976,115 @@ protected boolean _tracks(float x, float y, Frame frame) { int index = (int) y * width() + (int) x; if (backBuffer().pixels != null) if ((0 <= index) && (index < backBuffer().pixels.length)) - return backBuffer().pixels[index] == frame.id(); + return backBuffer().pixels[index] == frame.colorID(); return false; } + public void draw(Frame frame) { + _draw(frontBuffer(), frame); + } + + public void draw(PGraphics pGraphics, Frame frame) { + _draw(pGraphics, frame); + } + + @Override + protected void _draw(Object context, Frame frame) { + PGraphics pGraphics = (PGraphics) context; + pGraphics.pushStyle(); + pGraphics.pushMatrix(); + /* + if(_frontShape != null) + pg.shape(_frontShape); + set(pg); + frontShape(pg); + //*/ + ///* + //TODO needs more thinking + switch (frame.highlighting()) { + case FRONT: + if (frame.isTracked()) + pGraphics.scale(1.15f); + case NONE: + if (frame.frontShape() != null) + pGraphics.shape((PShape) frame.frontShape()); + else + frame.graphics(pGraphics); + break; + case FRONT_BACK: + if (frame.frontShape() != null) + pGraphics.shape((PShape) frame.frontShape()); + else + frame.frontGraphics(pGraphics); + if (frame.isTracked()) { + if (frame.backShape() != null) + pGraphics.shape((PShape) frame.backShape()); + else + frame.backGraphics(pGraphics); + } + break; + case BACK: + if (frame.isTracked()) { + if (frame.backShape() != null) + pGraphics.shape((PShape) frame.backShape()); + else + frame.backGraphics(pGraphics); + } else { + if (frame.frontShape() != null) + pGraphics.shape((PShape) frame.frontShape()); + else + frame.frontGraphics(pGraphics); + } + break; + } + //*/ + pGraphics.popStyle(); + pGraphics.popMatrix(); + } + + protected void _drawBackBuffer(Object context, Frame frame) { + PGraphics pGraphics = (PGraphics) context; + if (frame.precision() == Frame.Precision.EXACT) { + pGraphics.pushStyle(); + pGraphics.pushMatrix(); + + float r = (float) (frame.id() & 255) / 255.f; + float g = (float) ((frame.id() >> 8) & 255) / 255.f; + float b = (float) ((frame.id() >> 16) & 255) / 255.f; + + // funny, only safe way. Otherwise break things horribly when setting shapes + // and there are more than one shape + pGraphics.shader(_triangleShader); + pGraphics.shader(_lineShader, PApplet.LINES); + pGraphics.shader(_pointShader, PApplet.POINTS); + + _triangleShader.set("id", new PVector(r, g, b)); + _lineShader.set("id", new PVector(r, g, b)); + _pointShader.set("id", new PVector(r, g, b)); + + //pGraphics.pushStyle(); + //pGraphics.pushMatrix(); + /* + if (_backShape != null) + pg.shape(_backShape); + set(pg); + backShape(pg); + //*/ + ///* + if (frame.frontShape() != null) + pGraphics.shapeMode(frontBuffer().shapeMode); + if (frame.backShape() != null) + pGraphics.shape((PShape) frame.backShape()); + else { + frame.graphics(pGraphics); + frame.backGraphics(pGraphics); + } + //*/ + pGraphics.popStyle(); + pGraphics.popMatrix(); + } + } + /** * Renders the scene onto {@code pGraphics} using the {@code eye} frame point of view and * remaining frustum parameters. Useful to compute a shadow map taking the {@code eye} as diff --git a/src/frames/processing/Shape.java b/src/frames/processing/Shape.java deleted file mode 100644 index a5eb2a92..00000000 --- a/src/frames/processing/Shape.java +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************************** - * frames - * Copyright (c) 2018 National University of Colombia, https://visualcomputing.github.io/ - * @author Jean Pierre Charalambos, https://github.com/VisualComputing - * - * All rights reserved. A 2D or 3D scene graph library providing eye, input and timing - * handling to a third party (real or non-real time) renderer. Released under the terms - * of the GPL v3.0 which is available at http://www.gnu.org/licenses/gpl.html - ****************************************************************************************/ - -// Thanks goes to Sebastian Chaparro, https://github.com/sechaparroc -// for searching and providing an initial working picking example using a back buffer - -package frames.processing; - -import frames.core.Frame; -import frames.core.Graph; -import processing.core.PApplet; -import processing.core.PGraphics; -import processing.core.PShape; -import processing.core.PVector; - -/** - * A shape is a {@link Frame} specialization that should always be attached to a {@code scene} - * (see {@link Frame#isAttached(Graph)}) and that can be set from a retained-mode rendering Processing - * {@code Object} or from an immediate-mode rendering Processing procedure. Either case the shape is - * split in two a front and a back shape. The front shape will be used for rendering and the back - * shape for picking with exact precision by default, see {@link #setPrecision(Precision)}. When - * picking a shape it will be highlighted according to a highlighting policy, see - * {@link #setHighlighting(Highlighting)}. - *

- * Picking in an exact manner is costly. If performance is a concern, use a - * {@link #precision()} different than {@link Precision#EXACT} or a simpler representation - * for the back shape. - *

Retained mode

- * To set a retained-mode shape call {@link #shape(Object)} which will set both the front and - * the back shape to be the same pshape. Call {@link #frontShape(Object)} and - * {@link #frontShape(Object)} to set different graphics for rendering and picking, respectively. - *

Immediate mode

- * To set an immediate-mode shape override {@link #graphics(PGraphics)} which will set both the - * front and the back shape to be the same graphics procedure. Override - * {@link #frontGraphics(PGraphics)} and {@link #frontGraphics(PGraphics)} to set different - * graphics procedures for rendering and picking, respectively. - *

Picking

- * Picking a shape is done according to a precision which can either be: - * {@link Precision#FIXED}, {@link Precision#ADAPTIVE} or {@link Precision#EXACT}. Refer - * to the {@link Frame} documentation for both, {@link Precision#FIXED} and - * {@link Precision#ADAPTIVE}. The default {@link Precision#EXACT} precision use ray-casting - * of the pointer device over the projected pixels of the back shape. To set a different - * precision, use {@link #setPrecision(Precision)}. See also {@link #precision()}. - *

Highlighting

- * The shape may be highlighted when picking takes place according to a - * {@link #highlighting()} policy as follows: - * - *
    - *
  1. {@link Highlighting#NONE}: no highlighting takes place.
  2. - *
  3. {@link Highlighting#FRONT}: the front-shape (see {@link #frontShape(Object)} - * and {@link #frontGraphics(PGraphics)}) is scaled by a {@code 1.15} factor.
  4. - *
  5. {@link Highlighting#BACK}: the back-shape (see {@link #backShape(Object)} and - * {@link #backGraphics(PGraphics)}) is displayed instead of the front-shape.
  6. - *
  7. {@link Highlighting#FRONT_BACK}: both, the front and the back shapes are - * displayed. The back shape is made translucent
  8. - *
- *

- * Default is {@link Highlighting#FRONT}. Set the policy with - * {@link #setHighlighting(Highlighting)}). - */ -public class Shape extends Frame { - /** - * Constructs a scene 'attached' shape with {@link Precision#EXACT} and {@link Highlighting#FRONT} policy. - */ - public Shape(Scene scene) { - super(scene); - } - - /** - * Constructs a shape with {@link Precision#EXACT} and {@link Highlighting#FRONT} policy. - * Sets {@code reference} as its {@link #reference()} frame. - */ - public Shape(Frame reference) { - super(reference); - if (reference.isDetached()) - throw new RuntimeException("Shape reference should be attached to an scene"); - if (!(reference.graph() instanceof Scene)) - throw new RuntimeException("Graph reference of the shape should be instance of Scene"); - } - - /** - * Constructs a scene 'attached' shape with {@link Precision#EXACT} and {@link Highlighting#FRONT} policy. - * Sets {@code pShape} as its retained mode pshape. - */ - public Shape(Scene scene, Object pShape) { - this(scene); - shape(pShape); - } - - /** - * Constructs a shape with {@link Precision#EXACT} and {@link Highlighting#FRONT} policy. - * Sets {@code reference} as its {@link #reference() frame and {@code pShape} as its retained mode - * pshape. - */ - public Shape(Frame reference, Object pShape) { - this(reference); - shape(pShape); - } - - @Override - public Scene graph() { - return (Scene) _graph; - } - - /** - * Same as {@code draw(graph().frontBuffer())}. Use it instead of {@link Scene#render()}. - * - * @see Scene#render() - * @see #draw(Object) - */ - public void draw() { - draw(graph().frontBuffer()); - } - - @Override - public void draw(Object context) { - //if(context instanceof PGraphics) - if (context == graph().backBuffer()) - _drawBackBuffer((PGraphics) context); - else - _draw((PGraphics) context); - } - - protected void _draw(PGraphics pGraphics) { - pGraphics.pushStyle(); - pGraphics.pushMatrix(); - /* - if(_frontShape != null) - pg.shape(_frontShape); - set(pg); - frontShape(pg); - //*/ - ///* - //TODO needs more thinking - switch (highlighting()) { - case FRONT: - if (isTracked()) - pGraphics.scale(1.15f); - case NONE: - if (_frontShape != null) - pGraphics.shape((PShape) _frontShape); - else - graphics(pGraphics); - break; - case FRONT_BACK: - if (_frontShape != null) - pGraphics.shape((PShape) _frontShape); - else - frontGraphics(pGraphics); - if (isTracked()) { - if (_backShape != null) - pGraphics.shape((PShape) _backShape); - else - backGraphics(pGraphics); - } - break; - case BACK: - if (isTracked()) { - if (_backShape != null) - pGraphics.shape((PShape) _backShape); - else - backGraphics(pGraphics); - } else { - if (_frontShape != null) - pGraphics.shape((PShape) _frontShape); - else - frontGraphics(pGraphics); - } - break; - } - //*/ - pGraphics.popStyle(); - pGraphics.popMatrix(); - } - - protected void _drawBackBuffer(PGraphics pGraphics) { - if (precision() == Precision.EXACT) { - pGraphics.pushStyle(); - pGraphics.pushMatrix(); - - float r = (float) (_id & 255) / 255.f; - float g = (float) ((_id >> 8) & 255) / 255.f; - float b = (float) ((_id >> 16) & 255) / 255.f; - - // funny, only safe way. Otherwise break things horribly when setting shapes - // and there are more than one shape - pGraphics.shader(graph()._triangleShader); - pGraphics.shader(graph()._lineShader, PApplet.LINES); - pGraphics.shader(graph()._pointShader, PApplet.POINTS); - - graph()._triangleShader.set("id", new PVector(r, g, b)); - graph()._lineShader.set("id", new PVector(r, g, b)); - graph()._pointShader.set("id", new PVector(r, g, b)); - //pGraphics.pushStyle(); - //pGraphics.pushMatrix(); - /* - if (_backShape != null) - pg.shape(_backShape); - set(pg); - backShape(pg); - //*/ - ///* - if (_frontShape != null) - pGraphics.shapeMode(graph().frontBuffer().shapeMode); - if (_backShape != null) - pGraphics.shape((PShape) _backShape); - else { - graphics(pGraphics); - backGraphics(pGraphics); - } - //*/ - pGraphics.popStyle(); - pGraphics.popMatrix(); - } - } -} diff --git a/testing/src/intellij/AdaptivePrecision1.java b/testing/src/intellij/AdaptivePrecision1.java index a44e9f8d..646a0be6 100644 --- a/testing/src/intellij/AdaptivePrecision1.java +++ b/testing/src/intellij/AdaptivePrecision1.java @@ -2,7 +2,6 @@ import frames.core.Frame; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PShape; import processing.event.MouseEvent; @@ -12,8 +11,8 @@ */ public class AdaptivePrecision1 extends PApplet { Scene scene; - Shape[] shapes; - Shape trackedShape; + Frame[] shapes; + Frame trackedShape; public void settings() { size(1600, 800, P3D); @@ -23,9 +22,12 @@ public void setup() { rectMode(CENTER); scene = new Scene(this); scene.fit(1); - shapes = new Shape[25]; + shapes = new Frame[25]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene, shape()); + //shapes[i] = new Frame(scene, shape()); + shapes[i] = new Frame(scene); + shapes[i].shape(shape()); + scene.randomize(shapes[i]); shapes[i].setPrecisionThreshold(25); shapes[i].setPrecision(Frame.Precision.ADAPTIVE); @@ -39,7 +41,7 @@ public void draw() { //scene.draw(shapes[i]); pushMatrix(); scene.applyTransformation(shapes[i]); - shapes[i].draw(); + scene.draw(shapes[i]); popMatrix(); pushStyle(); stroke(255); diff --git a/testing/src/intellij/AdaptivePrecision2.java b/testing/src/intellij/AdaptivePrecision2.java index 25ab97fc..13090d8e 100644 --- a/testing/src/intellij/AdaptivePrecision2.java +++ b/testing/src/intellij/AdaptivePrecision2.java @@ -2,7 +2,6 @@ import frames.core.Frame; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PShape; import processing.event.MouseEvent; @@ -12,7 +11,7 @@ */ public class AdaptivePrecision2 extends PApplet { Scene scene; - Shape[] shapes; + Frame[] shapes; public void settings() { size(1600, 800, P3D); @@ -22,9 +21,11 @@ public void setup() { rectMode(CENTER); scene = new Scene(this); scene.fit(1); - shapes = new Shape[25]; + shapes = new Frame[25]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene, shape()); + //shapes[i] = new Frame(scene, shape()); + shapes[i] = new Frame(scene); + shapes[i].shape(shape()); scene.randomize(shapes[i]); shapes[i].setPrecisionThreshold(25); shapes[i].setPrecision(Frame.Precision.ADAPTIVE); @@ -38,7 +39,7 @@ public void draw() { //scene.draw(shapes[i]); pushMatrix(); scene.applyTransformation(shapes[i]); - shapes[i].draw(); + scene.draw(shapes[i]); popMatrix(); pushStyle(); stroke(255); diff --git a/testing/src/intellij/AdaptivePrecision3.java b/testing/src/intellij/AdaptivePrecision3.java index 0deecb52..62c3781e 100644 --- a/testing/src/intellij/AdaptivePrecision3.java +++ b/testing/src/intellij/AdaptivePrecision3.java @@ -2,7 +2,6 @@ import frames.core.Frame; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PShape; import processing.event.MouseEvent; @@ -12,7 +11,7 @@ */ public class AdaptivePrecision3 extends PApplet { Scene scene; - Shape[] shapes; + Frame[] shapes; public void settings() { size(1600, 800, P3D); @@ -22,9 +21,11 @@ public void setup() { rectMode(CENTER); scene = new Scene(this); scene.fit(1); - shapes = new Shape[25]; + shapes = new Frame[25]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene, shape(shapes[i])); + //shapes[i] = new Frame(scene, shape(shapes[i])); + shapes[i] = new Frame(scene); + shapes[i].shape(shape()); scene.randomize(shapes[i]); shapes[i].setPrecisionThreshold(25); shapes[i].setPrecision(Frame.Precision.ADAPTIVE); @@ -34,7 +35,7 @@ public void setup() { public void draw() { background(0); scene.drawAxes(); - scene.traverse(); + scene.render(); } public void keyPressed() { @@ -60,7 +61,7 @@ public void mouseClicked(MouseEvent event) { scene.cast(); } - PShape shape(Shape shape) { + PShape shape() { PShape fig = scene.is3D() ? createShape(BOX, 15) : createShape(RECT, 0, 0, 15, 15); fig.setStroke(255); fig.setFill(color(random(0, 255), random(0, 255), random(0, 255))); diff --git a/testing/src/intellij/ApplicationControl1.java b/testing/src/intellij/ApplicationControl1.java index 772ca718..4ca69457 100644 --- a/testing/src/intellij/ApplicationControl1.java +++ b/testing/src/intellij/ApplicationControl1.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PFont; import processing.core.PGraphics; @@ -11,7 +10,7 @@ public class ApplicationControl1 extends PApplet { Scene scene; - Shape[] shapes; + Frame[] shapes; PFont font36; int totalShapes; @@ -29,9 +28,9 @@ public void settings() { public void setup() { scene = new Scene(this); scene.fit(1); - shapes = new Shape[10]; + shapes = new Frame[10]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene) { + shapes[i] = new Frame(scene) { int id = totalShapes++; int _faces = randomFaces(), _color = randomColor(); diff --git a/testing/src/intellij/ApplicationControl2.java b/testing/src/intellij/ApplicationControl2.java index 96f665d2..b765f63f 100644 --- a/testing/src/intellij/ApplicationControl2.java +++ b/testing/src/intellij/ApplicationControl2.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PFont; import processing.core.PGraphics; @@ -11,7 +10,7 @@ public class ApplicationControl2 extends PApplet { Scene scene; - Shape[] shapes; + Frame[] shapes; PFont font36; int totalShapes; @@ -29,9 +28,9 @@ public void settings() { public void setup() { scene = new Scene(this); scene.fit(1); - shapes = new Shape[10]; + shapes = new Frame[10]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene) { + shapes[i] = new Frame(scene) { int id = totalShapes++; int _faces = randomFaces(), _color = randomColor(); diff --git a/testing/src/intellij/ApplicationControl3.java b/testing/src/intellij/ApplicationControl3.java index 686116b3..0728880e 100644 --- a/testing/src/intellij/ApplicationControl3.java +++ b/testing/src/intellij/ApplicationControl3.java @@ -1,8 +1,8 @@ package intellij; +import frames.core.Frame; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PFont; import processing.core.PGraphics; @@ -10,7 +10,7 @@ public class ApplicationControl3 extends PApplet { Scene scene; - Shape[] shapes; + Frame[] shapes; PFont font36; int totalShapes; @@ -29,9 +29,9 @@ public void setup() { scene = new Scene(this); scene.setFOV(PI / 3); scene.fit(1); - shapes = new Shape[10]; + shapes = new Frame[10]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene) { + shapes[i] = new Frame(scene) { int id = totalShapes++; int _faces = randomFaces(), _color = randomColor(); diff --git a/testing/src/intellij/Basics.java b/testing/src/intellij/Basics.java index 06ad736f..261eeda7 100644 --- a/testing/src/intellij/Basics.java +++ b/testing/src/intellij/Basics.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.primitives.Quaternion; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PShape; @@ -41,7 +40,9 @@ public void visit() { } }; frame.setRotation(Quaternion.random()); - shape = new Shape(scene, shape()); + //shape = new Frame(scene, shape()); + shape = new Frame(scene); + shape.shape(shape()); shape.setRotation(Quaternion.random()); shape.translate(275, 275, 275); } diff --git a/testing/src/intellij/DOF.java b/testing/src/intellij/DOF.java index 7b3426b7..c9ac2dd9 100644 --- a/testing/src/intellij/DOF.java +++ b/testing/src/intellij/DOF.java @@ -1,8 +1,8 @@ package intellij; +import frames.core.Frame; import frames.core.Graph; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -13,7 +13,7 @@ public class DOF extends PApplet { PShader depthShader, dofShader; PGraphics depthPGraphics, dofPGraphics; Scene scene; - Shape[] models; + Frame[] models; int mode = 2; @Override @@ -28,10 +28,12 @@ public void setup() { scene.setRadius(1000); scene.fit(1); - models = new Shape[100]; + models = new Frame[100]; for (int i = 0; i < models.length; i++) { - models[i] = new Shape(scene, boxShape()); + //models[i] = new Frame(scene, boxShape()); + models[i] = new Frame(scene); + models[i].shape(boxShape()); scene.randomize(models[i]); } diff --git a/testing/src/intellij/FrameInterpolation.java b/testing/src/intellij/FrameInterpolation.java index 6558208d..bc0db250 100644 --- a/testing/src/intellij/FrameInterpolation.java +++ b/testing/src/intellij/FrameInterpolation.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.core.Interpolator; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.event.MouseEvent; @@ -15,7 +14,7 @@ public class FrameInterpolation extends PApplet { Scene scene; Interpolator interpolator, eyeInterpolator1, eyeInterpolator2; - Shape shape; + Frame shape; boolean showEyePath = true; //Choose P3D for a 3D scene, or P2D or JAVA2D for a 2D scene @@ -39,7 +38,7 @@ public void setup() { // interpolation 3. Custom (arbitrary)frame interpolations - shape = new Shape(scene) { + shape = new Frame(scene) { // Note that within visit() geometry is defined at the // frame local coordinate system. @Override diff --git a/testing/src/intellij/Interaction2D.java b/testing/src/intellij/Interaction2D.java index 4b849715..e24b597e 100644 --- a/testing/src/intellij/Interaction2D.java +++ b/testing/src/intellij/Interaction2D.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PFont; import processing.core.PGraphics; @@ -15,7 +14,7 @@ */ public class Interaction2D extends PApplet { Scene scene; - Shape shape1, shape2, shape3; + Frame shape1, shape2, shape3; Vector upVector; PFont font36; @@ -31,7 +30,7 @@ public void setup() { //scene.eye().setScaling(1); //scene.fit(1); - shape1 = new Shape(scene) { + shape1 = new Frame(scene) { @Override public void graphics(PGraphics pGraphics) { scene.drawAxes(pGraphics, scene.radius() / 3); @@ -56,12 +55,12 @@ public void graphics(PGraphics pGraphics) { shape1.translate(-375, 175); shape1.setPrecision(Frame.Precision.FIXED); - shape2 = new Shape(shape1); + shape2 = new Frame(shape1); shape2.shape(shape()); shape2.translate(75, 475); shape2.setPrecision(Frame.Precision.FIXED); - shape3 = new Shape(shape2); + shape3 = new Frame(shape2); shape3.shape(createShape(RECT, 0, 0, 150, 150)); shape3.translate(-775, -575); shape3.setPrecision(Frame.Precision.FIXED); diff --git a/testing/src/intellij/MiniMap.java b/testing/src/intellij/MiniMap.java index 0125efef..81085ab5 100644 --- a/testing/src/intellij/MiniMap.java +++ b/testing/src/intellij/MiniMap.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.core.Graph; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -11,7 +10,7 @@ public class MiniMap extends PApplet { Scene scene, minimap, focus; - Shape[] models; + Frame[] models; Frame sceneEye; boolean displayMinimap = true; // whilst scene1 is either on-screen or not, the minimap is always off-screen @@ -37,12 +36,14 @@ public void setup() { if (scene.is2D()) rectMode(CENTER); scene.fit(1); - models = new Shape[6]; + models = new Frame[6]; for (int i = 0; i < models.length; i++) { if ((i & 1) == 0) { - models[i] = new Shape(scene, shape()); + //models[i] = new Frame(scene, shape()); + models[i] = new Frame(scene); + models[i].shape(shape()); } else { - models[i] = new Shape(scene) { + models[i] = new Frame(scene) { int _faces = (int) MiniMap.this.random(3, 15), _color = color(MiniMap.this.random(255), MiniMap.this.random(255), MiniMap.this.random(255)); @Override diff --git a/testing/src/intellij/MiniMap2.java b/testing/src/intellij/MiniMap2.java index 420f1d2f..6c06563f 100644 --- a/testing/src/intellij/MiniMap2.java +++ b/testing/src/intellij/MiniMap2.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.core.Graph; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -11,8 +10,8 @@ public class MiniMap2 extends PApplet { Scene scene, minimap, focus; - Shape[] models; - Shape sceneEye; + Frame[] models; + Frame sceneEye; boolean displayMinimap = true; // whilst scene1 is either on-screen or not, the minimap is always off-screen // test both cases here: @@ -37,12 +36,14 @@ public void setup() { if (scene.is2D()) rectMode(CENTER); scene.fit(1); - models = new Shape[6]; + models = new Frame[6]; for (int i = 0; i < models.length; i++) { if ((i & 1) == 0) { - models[i] = new Shape(scene, shape()); + //models[i] = new Frame(scene, shape()); + models[i] = new Frame(scene); + models[i].shape(shape()); } else { - models[i] = new Shape(scene) { + models[i] = new Frame(scene) { int _faces = (int) MiniMap2.this.random(3, 15), _color = color(MiniMap2.this.random(255), MiniMap2.this.random(255), MiniMap2.this.random(255)); @Override @@ -66,7 +67,7 @@ public void graphics(PGraphics pg) { //if (renderer == P3D) //minimap.setType(Graph.Type.ORTHOGRAPHIC); minimap.fit(1); - sceneEye = new Shape(minimap) { + sceneEye = new Frame(minimap) { @Override public void graphics(PGraphics pg) { pg.pushStyle(); diff --git a/testing/src/intellij/MouseDragInteraction.java b/testing/src/intellij/MouseDragInteraction.java index 3da94f82..9ffa2265 100644 --- a/testing/src/intellij/MouseDragInteraction.java +++ b/testing/src/intellij/MouseDragInteraction.java @@ -1,10 +1,10 @@ package intellij; +import frames.core.Frame; import frames.core.Graph; import frames.primitives.Quaternion; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -29,7 +29,7 @@ public void setup() { scene.setRadius(1000); scene.fit(1); - Shape shape1 = new Shape(scene) { + Frame shape1 = new Frame(scene) { @Override public void graphics(PGraphics pGraphics) { Scene.drawAxes(pGraphics, scene.radius() / 3); @@ -46,7 +46,7 @@ public void graphics(PGraphics pGraphics) { shape1.setRotation(Quaternion.random()); shape1.translate(-375, 175); - Shape shape2 = new Shape(shape1); + Frame shape2 = new Frame(shape1); shape2.shape(shape()); shape2.translate(275, 275); diff --git a/testing/src/intellij/MouseMoveInteraction.java b/testing/src/intellij/MouseMoveInteraction.java index eb9a38e8..c6730e32 100644 --- a/testing/src/intellij/MouseMoveInteraction.java +++ b/testing/src/intellij/MouseMoveInteraction.java @@ -1,8 +1,8 @@ package intellij; +import frames.core.Frame; import frames.primitives.Quaternion; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -25,7 +25,7 @@ public void setup() { scene.setRadius(1000); scene.fit(1); - Shape shape1 = new Shape(scene) { + Frame shape1 = new Frame(scene) { @Override public void graphics(PGraphics pGraphics) { pGraphics.pushStyle(); @@ -41,7 +41,7 @@ public void graphics(PGraphics pGraphics) { shape1.setRotation(Quaternion.random()); shape1.translate(-375, 175, -275); - Shape shape2 = new Shape(shape1); + Frame shape2 = new Frame(shape1); shape2.shape(shape()); shape2.translate(275, 275, 275); } diff --git a/testing/src/intellij/OFFScreen.java b/testing/src/intellij/OFFScreen.java index 84f09fc3..4a149349 100644 --- a/testing/src/intellij/OFFScreen.java +++ b/testing/src/intellij/OFFScreen.java @@ -1,8 +1,8 @@ package intellij; +import frames.core.Frame; import frames.primitives.Quaternion; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -10,7 +10,7 @@ public class OFFScreen extends PApplet { Scene scene; - Shape shape1, shape2; + Frame shape1, shape2; //Choose FX2D, JAVA2D, P2D or P3D String renderer = P3D; @@ -25,7 +25,7 @@ public void setup() { scene.setRadius(300); scene.fit(1); - shape1 = new Shape(scene) { + shape1 = new Frame(scene) { @Override public void graphics(PGraphics pGraphics) { scene.drawAxes(pGraphics, scene.radius() / 3); @@ -42,7 +42,7 @@ public void graphics(PGraphics pGraphics) { shape1.setRotation(Quaternion.random()); shape1.translate(-55, -55, -55); - shape2 = new Shape(shape1); + shape2 = new Frame(shape1); shape2.shape(shape()); shape2.translate(-55, -85, 135); } diff --git a/testing/src/intellij/Orbit.java b/testing/src/intellij/Orbit.java index f6f59c19..5abe7c47 100644 --- a/testing/src/intellij/Orbit.java +++ b/testing/src/intellij/Orbit.java @@ -1,9 +1,9 @@ package intellij; +import frames.core.Frame; import frames.primitives.Quaternion; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -14,7 +14,7 @@ */ public class Orbit extends PApplet { Scene scene; - Shape shape1, shape2; + Frame shape1, shape2; Vector axis; public void settings() { @@ -27,7 +27,7 @@ public void setup() { scene.setRadius(1000); scene.fit(1); - shape1 = new Shape(scene) { + shape1 = new Frame(scene) { @Override public void graphics(PGraphics pGraphics) { scene.drawAxes(pGraphics, scene.radius() / 3); @@ -44,8 +44,8 @@ public void graphics(PGraphics pGraphics) { shape1.setRotation(Quaternion.random()); shape1.translate(-375, 175, -275); - //shape2 = new Shape(shape1); - shape2 = new Shape(scene); + //shape2 = new Frame(shape1); + shape2 = new Frame(scene); shape2.shape(shape()); shape2.translate(275, 275, 275); diff --git a/testing/src/intellij/SceneBuffers.java b/testing/src/intellij/SceneBuffers.java index 357f4594..69350af1 100644 --- a/testing/src/intellij/SceneBuffers.java +++ b/testing/src/intellij/SceneBuffers.java @@ -1,14 +1,14 @@ package intellij; +import frames.core.Frame; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PShape; import processing.event.MouseEvent; public class SceneBuffers extends PApplet { Scene scene; - Shape[] shapes; + Frame[] shapes; //Choose one of P3D for a 3D scene or P2D for a 2D one. String renderer = P3D; @@ -24,9 +24,9 @@ public void setup() { scene = new Scene(this, createGraphics(w, h / 2, renderer)); scene.setRadius(max(w, h)); - shapes = new Shape[100]; + shapes = new Frame[100]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene); + shapes[i] = new Frame(scene); shapes[i].shape(caja()); shapes[i].randomize(); } diff --git a/testing/src/intellij/ShadowMapDOFOffScreen.java b/testing/src/intellij/ShadowMapDOFOffScreen.java index 232fed6d..7342b564 100644 --- a/testing/src/intellij/ShadowMapDOFOffScreen.java +++ b/testing/src/intellij/ShadowMapDOFOffScreen.java @@ -1,10 +1,10 @@ package intellij; +import frames.core.Frame; import frames.core.Graph; import frames.primitives.Quaternion; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.event.MouseEvent; @@ -13,7 +13,7 @@ public class ShadowMapDOFOffScreen extends PApplet { Graph.Type shadowMapType = Graph.Type.ORTHOGRAPHIC; Scene scene; - Shape[] shapes; + Frame[] shapes; PGraphics lightPGraphics, depthPGraphics, dofPGraphics; PShader depthShader, dofShader; int mode = 0; @@ -27,9 +27,9 @@ public void settings() { public void setup() { scene = new Scene(this, P3D); scene.setRadius(max(width, height)); - shapes = new Shape[20]; + shapes = new Frame[20]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene) { + shapes[i] = new Frame(scene) { @Override public void graphics(PGraphics pg) { pg.pushStyle(); @@ -66,7 +66,7 @@ public void interact(Object... gesture) { }; shapes[i].randomize(); //shapes[i].setPrecision(Frame.Precision.FIXED); - shapes[i].setHighlighting(Shape.Highlighting.NONE); + shapes[i].setHighlighting(Frame.Highlighting.NONE); } //scene._bbEnabled = false; scene.setRadius(scene.radius() * 1.2f); diff --git a/testing/src/intellij/ShadowMapDOFOnScreen.java b/testing/src/intellij/ShadowMapDOFOnScreen.java index 68159082..a0132a3c 100644 --- a/testing/src/intellij/ShadowMapDOFOnScreen.java +++ b/testing/src/intellij/ShadowMapDOFOnScreen.java @@ -1,10 +1,10 @@ package intellij; +import frames.core.Frame; import frames.core.Graph; import frames.primitives.Quaternion; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.event.MouseEvent; @@ -13,7 +13,7 @@ public class ShadowMapDOFOnScreen extends PApplet { Graph.Type shadowMapType = Graph.Type.ORTHOGRAPHIC; Scene scene; - Shape[] shapes; + Frame[] shapes; PGraphics lightPGraphics, depthPGraphics, dofPGraphics; PShader depthShader, dofShader; int mode = 0; @@ -27,9 +27,9 @@ public void settings() { public void setup() { scene = new Scene(this); scene.setRadius(max(width, height)); - shapes = new Shape[20]; + shapes = new Frame[20]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene) { + shapes[i] = new Frame(scene) { @Override public void graphics(PGraphics pg) { pg.pushStyle(); @@ -65,7 +65,7 @@ public void interact(Object... gesture) { // */ }; shapes[i].randomize(); - shapes[i].setHighlighting(Shape.Highlighting.NONE); + shapes[i].setHighlighting(Frame.Highlighting.NONE); } scene.setRadius(scene.radius() * 1.2f); scene.fit(1); diff --git a/testing/src/intellij/ShadowMapDepthOnScreen.java b/testing/src/intellij/ShadowMapDepthOnScreen.java index 4ff9f458..77adfd4a 100644 --- a/testing/src/intellij/ShadowMapDepthOnScreen.java +++ b/testing/src/intellij/ShadowMapDepthOnScreen.java @@ -1,10 +1,10 @@ package intellij; +import frames.core.Frame; import frames.core.Graph; import frames.primitives.Quaternion; import frames.primitives.Vector; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.event.MouseEvent; @@ -13,7 +13,7 @@ public class ShadowMapDepthOnScreen extends PApplet { Graph.Type shadowMapType = Graph.Type.ORTHOGRAPHIC; Scene scene; - Shape[] shapes; + Frame[] shapes; PGraphics shadowMap; PShader depthShader; boolean one; @@ -29,9 +29,9 @@ public void settings() { public void setup() { scene = new Scene(this); scene.setRadius(max(w, h)); - shapes = new Shape[20]; + shapes = new Frame[20]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene) { + shapes[i] = new Frame(scene) { @Override public void graphics(PGraphics pg) { pg.pushStyle(); @@ -67,7 +67,7 @@ public void interact(Object... gesture) { } }; shapes[i].randomize(); - shapes[i].setHighlighting(Shape.Highlighting.NONE); + shapes[i].setHighlighting(Frame.Highlighting.NONE); } scene.setRadius(scene.radius() * 1.2f); scene.fit(1); diff --git a/testing/src/intellij/ShadowMapOnScreen.java b/testing/src/intellij/ShadowMapOnScreen.java index 60f5fa5a..c88b6f3b 100644 --- a/testing/src/intellij/ShadowMapOnScreen.java +++ b/testing/src/intellij/ShadowMapOnScreen.java @@ -1,8 +1,8 @@ package intellij; +import frames.core.Frame; import frames.core.Graph; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -11,8 +11,8 @@ public class ShadowMapOnScreen extends PApplet { Graph.Type shadowMapType = Graph.Type.ORTHOGRAPHIC; Scene scene; - Shape[] shapes; - Shape light; + Frame[] shapes; + Frame light; boolean show = true; PGraphics shadowMap; float zNear = 50; @@ -27,13 +27,13 @@ public void settings() { public void setup() { scene = new Scene(this); scene.setRadius(max(w, h)); - shapes = new Shape[20]; + shapes = new Frame[20]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene); + shapes[i] = new Frame(scene); shapes[i].shape(caja()); shapes[i].randomize(); } - light = new Shape(scene) { + light = new Frame(scene) { @Override public void graphics(PGraphics pg) { pg.pushStyle(); diff --git a/testing/src/intellij/ShadowMapping.java b/testing/src/intellij/ShadowMapping.java index 294341e8..8602c5a6 100644 --- a/testing/src/intellij/ShadowMapping.java +++ b/testing/src/intellij/ShadowMapping.java @@ -1,8 +1,8 @@ package intellij; +import frames.core.Frame; import frames.core.Graph; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -11,8 +11,8 @@ public class ShadowMapping extends PApplet { Graph.Type shadowMapType = Graph.Type.ORTHOGRAPHIC; Scene scene; - Shape[] shapes; - Shape light; + Frame[] shapes; + Frame light; boolean show = true; PGraphics shadowMap; float zNear = 50; @@ -27,13 +27,13 @@ public void settings() { public void setup() { scene = new Scene(this); scene.setRadius(max(w, h)); - shapes = new Shape[20]; + shapes = new Frame[20]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene); + shapes[i] = new Frame(scene); shapes[i].shape(caja()); shapes[i].randomize(); } - light = new Shape(scene) { + light = new Frame(scene) { @Override public void graphics(PGraphics pg) { pg.pushStyle(); diff --git a/testing/src/intellij/ShiftViewers.java b/testing/src/intellij/ShiftViewers.java index 67b5ac60..ab7e5360 100644 --- a/testing/src/intellij/ShiftViewers.java +++ b/testing/src/intellij/ShiftViewers.java @@ -3,7 +3,6 @@ import frames.core.Frame; import frames.core.Graph; import frames.processing.Scene; -import frames.processing.Shape; import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PShape; @@ -11,7 +10,7 @@ public class ShiftViewers extends PApplet { Scene scene1, scene2, scene3, focus; - Shape[] models; + Frame[] models; boolean displayAuxiliarViewers = true; // whilst scene1 is either on-screen or not; scene2 and scene3 are off-screen // test both cases here @@ -30,12 +29,14 @@ public void setup() { // set a detached eye frame scene1.setEye(new Frame()); scene1.fit(1); - models = new Shape[5]; + models = new Frame[5]; for (int i = 0; i < models.length; i++) { if ((i & 1) == 0) { - models[i] = new Shape(scene1, boxShape()); + //models[i] = new Frame(scene1, boxShape()); + models[i] = new Frame(scene1); + models[i].shape(boxShape()); } else { - models[i] = new Shape(scene1) { + models[i] = new Frame(scene1) { int _faces = (int) ShiftViewers.this.random(3, 15), _color = color(ShiftViewers.this.random(255), ShiftViewers.this.random(255), ShiftViewers.this.random(255)); @Override public void graphics(PGraphics pg) { diff --git a/testing/src/intellij/SpaceNavigator.java b/testing/src/intellij/SpaceNavigator.java index 464b74ee..4dcd68d7 100644 --- a/testing/src/intellij/SpaceNavigator.java +++ b/testing/src/intellij/SpaceNavigator.java @@ -1,7 +1,7 @@ package intellij; +import frames.core.Frame; import frames.processing.Scene; -import frames.processing.Shape; import org.gamecontrolplus.ControlButton; import org.gamecontrolplus.ControlDevice; import org.gamecontrolplus.ControlIO; @@ -37,9 +37,11 @@ public void setup() { //scene.setType(Graph.Type.ORTHOGRAPHIC); scene.setRadius(1500); scene.fit(1); - Shape[] shapes = new Shape[50]; + Frame[] shapes = new Frame[50]; for (int i = 0; i < shapes.length; i++) { - shapes[i] = new Shape(scene, shape()); + //shapes[i] = new Frame(scene, shape()); + shapes[i] = new Frame(scene); + shapes[i].shape(shape()); scene.randomize(shapes[i]); } smooth(); diff --git a/web/index.html b/web/index.html index b1d502d1..771c2504 100644 --- a/web/index.html +++ b/web/index.html @@ -100,7 +100,7 @@

Tested