From d85866ff1b3493bba99a49bfc2d3fc9156e26947 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 28 Feb 2005 02:30:47 +0000 Subject: [PATCH] tweaking --- processing/core/PGraphics3.java | 10 +++++++++- processing/core/todo.txt | 15 ++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/processing/core/PGraphics3.java b/processing/core/PGraphics3.java index f362e4b36..9186d2d38 100644 --- a/processing/core/PGraphics3.java +++ b/processing/core/PGraphics3.java @@ -817,7 +817,13 @@ public class PGraphics3 extends PGraphics { stop = vertex_end - 2; increment = (shape == TRIANGLES) ? 3 : 1; for (int i = vertex_start; i < stop; i += increment) { - add_triangle(i, i+1, i+2); + // have to switch between clockwise/counter-clockwise + // otherwise the feller is backwards and renderer won't draw + if ((i % 2) == 0) { + add_triangle(i, i+2, i+1); + } else { + add_triangle(i, i+1, i+2); + } } } break; @@ -972,6 +978,7 @@ public class PGraphics3 extends PGraphics { protected void depth_sort_triangles() { } + protected void render_triangles() { //public void render_triangles() { //System.out.println("PGraphics3 render triangles"); @@ -1008,6 +1015,7 @@ public class PGraphics3 extends PGraphics { protected void depth_sort_lines() { } + protected void render_lines() { for (int i = 0; i < lineCount; i ++) { float a[] = vertices[lines[i][VERTEX1]]; diff --git a/processing/core/todo.txt b/processing/core/todo.txt index 86d8c4567..5c6ed44bc 100644 --- a/processing/core/todo.txt +++ b/processing/core/todo.txt @@ -98,6 +98,10 @@ X can't use regular getPixels() on PGraphics, because its image isn't 'cache' X also, the cache may be used to draw the whole surface as a gl texture (?) X not a problem for the main PGraphics, but for any others created to draw on +opengl +X make light() functions actually do something in PGraphicsGL +X box() and sphere() working again + api todos _ sphere x,y,z,r or box w,h,d.. need to make them consistent _ look at curve functions more closely @@ -105,6 +109,10 @@ _ should we switch to curveVertex(1,2,3) (ala curveto) _ because some confusion with mixing types of curves _ how to force PGraphics() instead of PGraphics2() +_ make opengl work in draw mode + +_ lighting totally sucks + _ make sure applet is stopping in draw mode _ get frame recording working @@ -116,9 +124,7 @@ _ move textMode and textSpace back out of PFont _ use die() to fail in font situations _ can't, just use a RuntimeException -_ get regular graphics engine working again -_ smooth is no longer working -_ ellipses aren't handled +_ get PGraphics.java engine working again _ default to single byte input from serial port _ and add serial.setBuffer() for message length as alternative @@ -132,8 +138,7 @@ _ for postscript, can grab the real font _ -> altho problem here is that really the fonts just need a name _ since needs to render to screen as well -_ make light() functions actually do something in PGraphicsGL -_ make lights half do something in PGraphics3 too +_ fix lighting in PGraphics3 _ bring in materials for opengl as well? _ don't include a class, just make it similar to the light functions