fix for bug #444

This commit is contained in:
benfry
2006-11-16 21:56:20 +00:00
parent bbd8016272
commit 0a09c27098
3 changed files with 24 additions and 16 deletions

View File

@@ -281,10 +281,10 @@ public abstract class PGraphics extends PImage implements PConstants {
// [toxi 031031]
// changed table's precision to 0.5 degree steps
// introduced new vars for more flexible code
static final float sinLUT[];
static final float cosLUT[];
static final float SINCOS_PRECISION = 0.5f;
static final int SINCOS_LENGTH = (int) (360f / SINCOS_PRECISION);
static final protected float sinLUT[];
static final protected float cosLUT[];
static final protected float SINCOS_PRECISION = 0.5f;
static final protected int SINCOS_LENGTH = (int) (360f / SINCOS_PRECISION);
static {
sinLUT = new float[SINCOS_LENGTH];
cosLUT = new float[SINCOS_LENGTH];
@@ -1108,10 +1108,10 @@ public abstract class PGraphics extends PImage implements PConstants {
/** This feature is in testing, do not use or rely upon its implementation */
public void breakShape() {
public void breakShape() {
}
public final void endShape() {
endShape(OPEN);
}

View File

@@ -565,15 +565,20 @@ public class PGraphics3D extends PGraphics {
}
float vertex[] = vertices[vertexCount];
//if (polygon.redundantVertex(x, y, z)) return;
if (vertexCount > 0) {
float pvertex[] = vertices[vertexCount-1];
if ((abs(pvertex[MX] - x) < EPSILON) &&
(abs(pvertex[MY] - y) < EPSILON) &&
(abs(pvertex[MZ] - z) < EPSILON)) {
// this vertex is identical, don't add it,
// because it will anger the triangulator
return;
// only do this if we're using an irregular (POLYGON) shape that
// will go through the triangulator. otherwise it'll do thinks like
// disappear in mathematically odd ways
// http://dev.processing.org/bugs/show_bug.cgi?id=444
if (shape == POLYGON) {
if (vertexCount > 0) {
float pvertex[] = vertices[vertexCount-1];
if ((abs(pvertex[MX] - x) < EPSILON) &&
(abs(pvertex[MY] - y) < EPSILON) &&
(abs(pvertex[MZ] - z) < EPSILON)) {
// this vertex is identical, don't add it,
// because it will anger the triangulator
return;
}
}
}

View File

@@ -6,6 +6,9 @@ X lerpColor(c1, c2, amt, RGB/HSB/???)
_ test this out for a bit
_ though that's awkward b/c colors always RGB
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Suggestions;action=display;num=1160096087
X regression in P3D that prevents point() from drawing
X problem is with setup_vertex() not adding similar points
X http://dev.processing.org/bugs/show_bug.cgi?id=444
fixed earlier, bug cleaning
X gray background in pdf (using both gl and p3d)