summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java31
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java35
3 files changed, 54 insertions, 48 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index be5a1d1bf..e14266c05 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -651,16 +651,17 @@ public final class OutlineShape implements Comparable<OutlineShape> {
*
* @param x point (P1)
* @param y point (P1)
+ * @param z point (P1)
* @see Path2F#moveTo(float, float)
* @see #addPath(com.jogamp.graph.geom.plane.Path2F.Iterator, boolean)
*/
- public final void moveTo(final float x, final float y) {
+ public final void moveTo(final float x, final float y, final float z) {
if ( 0 == getLastOutline().getVertexCount() ) {
- addVertex(x, y, true);
+ addVertex(x, y, z, true);
} else {
closeLastOutline(false);
addEmptyOutline();
- addVertex(x, y, true);
+ addVertex(x, y, z, true);
}
}
@@ -671,11 +672,12 @@ public final class OutlineShape implements Comparable<OutlineShape> {
*
* @param x final point (P1)
* @param y final point (P1)
+ * @param z final point (P1)
* @see Path2F#lineTo(float, float)
* @see #addPath(com.jogamp.graph.geom.plane.Path2F.Iterator, boolean)
*/
- public final void lineTo(final float x, final float y) {
- addVertex(x, y, true);
+ public final void lineTo(final float x, final float y, final float z) {
+ addVertex(x, y, z, true);
}
/**
@@ -685,14 +687,16 @@ public final class OutlineShape implements Comparable<OutlineShape> {
*
* @param x1 quadratic parametric control point (P1)
* @param y1 quadratic parametric control point (P1)
+ * @param z1 quadratic parametric control point (P1)
* @param x2 final interpolated control point (P2)
* @param y2 final interpolated control point (P2)
+ * @param z2 quadratic parametric control point (P2)
* @see Path2F#quadTo(float, float, float, float)
* @see #addPath(com.jogamp.graph.geom.plane.Path2F.Iterator, boolean)
*/
- public final void quadTo(final float x1, final float y1, final float x2, final float y2) {
- addVertex(x1, y1, false);
- addVertex(x2, y2, true);
+ public final void quadTo(final float x1, final float y1, final float z1, final float x2, final float y2, final float z2) {
+ addVertex(x1, y1, z1, false);
+ addVertex(x2, y2, z2, true);
}
/**
@@ -702,17 +706,20 @@ public final class OutlineShape implements Comparable<OutlineShape> {
*
* @param x1 Bézier control point (P1)
* @param y1 Bézier control point (P1)
+ * @param z1 Bézier control point (P1)
* @param x2 Bézier control point (P2)
* @param y2 Bézier control point (P2)
+ * @param z2 Bézier control point (P2)
* @param x3 final interpolated control point (P3)
* @param y3 final interpolated control point (P3)
+ * @param z3 final interpolated control point (P3)
* @see Path2F#cubicTo(float, float, float, float, float, float)
* @see #addPath(com.jogamp.graph.geom.plane.Path2F.Iterator, boolean)
*/
- public final void cubicTo(final float x1, final float y1, final float x2, final float y2, final float x3, final float y3) {
- addVertex(x1, y1, false);
- addVertex(x2, y2, false);
- addVertex(x3, y3, true);
+ public final void cubicTo(final float x1, final float y1, final float z1, final float x2, final float y2, final float z2, final float x3, final float y3, final float z3) {
+ addVertex(x1, y1, z1, false);
+ addVertex(x2, y2, z2, false);
+ addVertex(x3, y3, z3, true);
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
index 7dc217c2d..b78826a6d 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
@@ -99,30 +99,30 @@ public class GPURegionGLListener01 extends GPURendererListenerBase01 {
}
private void createTestOutline01(){
- outlineShape.moveTo(0.0f,-10.0f);
- outlineShape.lineTo(15.0f,-10.0f);
- outlineShape.quadTo(10.0f,5.0f, 15.0f,10.0f);
- outlineShape.cubicTo(6.0f,15.0f, 5.0f,8.0f, 0.0f,10.0f);
+ outlineShape.moveTo(0.0f,-10.0f, 0f);
+ outlineShape.lineTo(15.0f,-10.0f, 0f);
+ outlineShape.quadTo(10.0f,5.0f,0f, 15.0f,10.0f,0f);
+ outlineShape.cubicTo(6.0f,15.0f,0f, 5.0f,8.0f,0f, 0.0f,10.0f,0f);
outlineShape.closePath();
- outlineShape.moveTo(5.0f,-5.0f);
- outlineShape.quadTo(10.0f,-5.0f, 10.0f,0.0f);
- outlineShape.quadTo(5.0f,0.0f, 5.0f,-5.0f);
+ outlineShape.moveTo(5.0f,-5.0f,0f);
+ outlineShape.quadTo(10.0f,-5.0f,0f, 10.0f,0.0f,0f);
+ outlineShape.quadTo(5.0f,0.0f,0f, 5.0f,-5.0f,0f);
outlineShape.closePath();
/** Same shape as above but without any off-curve vertices */
final float offset = 30;
- outlineShape.moveTo(offset+0.0f,-10.0f);
- outlineShape.lineTo(offset+17.0f,-10.0f);
- outlineShape.lineTo(offset+11.0f,5.0f);
- outlineShape.lineTo(offset+16.0f,10.0f);
- outlineShape.lineTo(offset+7.0f,15.0f);
- outlineShape.lineTo(offset+6.0f,8.0f);
- outlineShape.lineTo(offset+0.0f,10.0f);
+ outlineShape.moveTo(offset+0.0f,-10.0f,0f);
+ outlineShape.lineTo(offset+17.0f,-10.0f,0f);
+ outlineShape.lineTo(offset+11.0f,5.0f,0f);
+ outlineShape.lineTo(offset+16.0f,10.0f,0f);
+ outlineShape.lineTo(offset+7.0f,15.0f,0f);
+ outlineShape.lineTo(offset+6.0f,8.0f,0f);
+ outlineShape.lineTo(offset+0.0f,10.0f,0f);
outlineShape.closePath();
- outlineShape.moveTo(offset+5.0f,0.0f);
- outlineShape.lineTo(offset+5.0f,-5.0f);
- outlineShape.lineTo(offset+10.0f,-5.0f);
- outlineShape.lineTo(offset+10.0f,0.0f);
+ outlineShape.moveTo(offset+5.0f,0.0f,0f);
+ outlineShape.lineTo(offset+5.0f,-5.0f,0f);
+ outlineShape.lineTo(offset+10.0f,-5.0f,0f);
+ outlineShape.lineTo(offset+10.0f,0.0f,0f);
outlineShape.closePath();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
index a7c0bf84b..209ce3e57 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
@@ -77,24 +77,23 @@ public class CrossHair extends UIShape {
final float lwh = lineWidth/2f;
final float ctrX = 0f, ctrY = 0f;
- float ctrZ = 0f;
-
- // vertical (CCW!)
- shape.addVertex(ctrX-lwh, ctrY-thh, ctrZ, true);
- shape.addVertex(ctrX+lwh, ctrY-thh, ctrZ, true);
- shape.addVertex(ctrX+lwh, ctrY+thh, ctrZ, true);
- shape.addVertex(ctrX-lwh, ctrY+thh, ctrZ, true);
- shape.closeLastOutline(true);
-
- ctrZ -= 0.05f;
-
- // horizontal (CCW!)
- shape.addEmptyOutline();
- shape.addVertex(ctrX-twh, ctrY-lwh, ctrZ, true);
- shape.addVertex(ctrX+twh, ctrY-lwh, ctrZ, true);
- shape.addVertex(ctrX+twh, ctrY+lwh, ctrZ, true);
- shape.addVertex(ctrX-twh, ctrY+lwh, ctrZ, true);
- shape.closeLastOutline(true);
+ final float ctrZ = 0f;
+
+ // middle vertical (CCW!)
+ shape.moveTo(ctrX-lwh, ctrY-thh, ctrZ);
+ shape.lineTo(ctrX+lwh, ctrY-thh, ctrZ);
+ shape.lineTo(ctrX+lwh, ctrY+thh, ctrZ);
+ shape.lineTo(ctrX-lwh, ctrY+thh, ctrZ);
+ shape.closePath();
+
+ // ctrZ -= 0.05f;
+
+ // middle horizontal (CCW!)
+ shape.moveTo(ctrX-twh, ctrY-lwh, ctrZ);
+ shape.lineTo(ctrX+twh, ctrY-lwh, ctrZ);
+ shape.lineTo(ctrX+twh, ctrY+lwh, ctrZ);
+ shape.lineTo(ctrX-twh, ctrY+lwh, ctrZ);
+ shape.closePath();
shape.setIsQuadraticNurbs();
shape.setSharpness(shapesSharpness);