More on 3D warnings

This commit is contained in:
codeanticode
2012-05-22 02:51:50 +00:00
parent 527d339ee4
commit a4af82c9e1
4 changed files with 80 additions and 13 deletions
@@ -8635,7 +8635,7 @@ public class PGraphicsOpenGL extends PGraphics {
float y0 = in.vertices[index++];
float z0 = in.vertices[index ];
index = 4 * inIdx1;
index = 3 * inIdx1;
float x1 = in.vertices[index++];
float y1 = in.vertices[index++];
float z1 = in.vertices[index ];
@@ -39,6 +39,12 @@ public class PShape2D extends PShapeOpenGL {
return false;
}
///////////////////////////////////////////////////////////
//
// Drawing methods
public void vertex(float x, float y, float z) {
PGraphics.showDepthWarningXYZ("vertex");
}
@@ -47,6 +53,33 @@ public class PShape2D extends PShapeOpenGL {
PGraphics.showDepthWarningXYZ("vertex");
}
///////////////////////////////////////////////////////////
//
// Bezier curves
public void bezierVertex(float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4) {
PGraphics.showDepthWarningXYZ("bezierVertex");
}
public void quadraticVertex(float x2, float y2, float z2,
float x4, float y4, float z4) {
PGraphics.showDepthWarningXYZ("quadVertex");
}
public void curveVertex(float x, float y, float z) {
PGraphics.showDepthWarningXYZ("curveVertex");
}
///////////////////////////////////////////////////////////
//
// Geometric transformations
public void translate(float tx, float ty, float tz) {
PGraphics.showVariationWarning("translate");
}
@@ -78,10 +111,16 @@ public class PShape2D extends PShapeOpenGL {
PGraphics.showDepthWarningXYZ("scale");
}
///////////////////////////////////////////////////////////
//
// Setters/getters of individual vertices
public float getVertexZ(int index) {
PGraphics.showDepthWarningXYZ("getVertexZ");
return 0;
}
}
public void setVertex(int index, float x, float y) {
super.setVertex(index, x, y, 0);
@@ -1664,6 +1664,14 @@ public class PShapeOpenGL extends PShape {
transform(SCALE, x, y, z);
}
public void applyMatrix(PMatrix2D source) {
transform(MATRIX, source.m00, source.m01, 0, source.m02,
source.m10, source.m11, 0, source.m12,
0, 0, 1, 0,
0, 0, 0, 1);
}
public void applyMatrix(float n00, float n01, float n02,
float n10, float n11, float n12) {
@@ -1821,15 +1829,24 @@ public class PShapeOpenGL extends PShape {
public void bezierVertex(float x2, float y2,
float x3, float y3,
float x4, float y4) {
bezierVertex(x2, y2, 0,
x3, y3, 0,
x4, y4, 0);
bezierVertexImpl(x2, y2, 0,
x3, y3, 0,
x4, y4, 0);
}
public void bezierVertex(float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4) {
bezierVertexImpl(x2, y2, z2,
x3, y3, z3,
x4, y4, z4);
}
protected void bezierVertexImpl(float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4) {
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
ambientColor, specularColor, emissiveColor, shininess);
inGeo.setNormal(normalX, normalY, normalZ);
@@ -1842,13 +1859,20 @@ public class PShapeOpenGL extends PShape {
public void quadraticVertex(float cx, float cy,
float x3, float y3) {
quadraticVertex(cx, cy, 0,
x3, y3, 0);
quadraticVertexImpl(cx, cy, 0,
x3, y3, 0);
}
public void quadraticVertex(float cx, float cy, float cz,
float x3, float y3, float z3) {
quadraticVertexImpl(cx, cy, cz,
x3, y3, z3);
}
protected void quadraticVertexImpl(float cx, float cy, float cz,
float x3, float y3, float z3) {
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
ambientColor, specularColor, emissiveColor, shininess);
inGeo.setNormal(normalX, normalY, normalZ);
@@ -1878,11 +1902,16 @@ public class PShapeOpenGL extends PShape {
public void curveVertex(float x, float y) {
curveVertex(x, y, 0);
curveVertexImpl(x, y, 0);
}
public void curveVertex(float x, float y, float z) {
curveVertexImpl(x, y, z);
}
protected void curveVertexImpl(float x, float y, float z) {
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
ambientColor, specularColor, emissiveColor, shininess);
inGeo.setNormal(normalX, normalY, normalZ);
@@ -3313,7 +3342,8 @@ public class PShapeOpenGL extends PShape {
protected boolean startStrokeCache(int n) {
return n == firstLineIndexCache || n == firstPointIndexCache;
return texture != null && (n == firstLineIndexCache || n == firstPointIndexCache);
// return n == firstLineIndexCache || n == firstPointIndexCache;
}