Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixes for new processing

  • Loading branch information...
commit 8908d384f111c8de5a334d6b010378e0f497ea01 1 parent ed03df7
Justin Day authored
14 BlinkeyDomeSimulator.pde
@@ -4,8 +4,9 @@ import peasy.org.apache.commons.math.geometry.*;
4 4 import processing.opengl.*;
5 5 import javax.media.opengl.GL;
6 6 import hypermedia.net.*;
7   -
8 7 import java.util.concurrent.*;
  8 +import javax.media.opengl.GL2;
  9 +
9 10
10 11 int DOME_RADIUS = 8;
11 12 int strips = 40; // Number of strips around the circumference of the sphere
@@ -14,13 +15,10 @@ int packet_length = strips*lights_per_strip*3 + 1;
14 15
15 16 Boolean demoMode = true;
16 17 BlockingQueue newImageQueue;
17   -
18 18 color[][] frameBuffer;
19 19
20 20 DemoTransmitter demoTransmitter;
21   -
22 21 UDP udp;
23   -
24 22 PeasyCam pCamera;
25 23 BlinkeyLights blinkeyLights;
26 24 Dome dome;
@@ -37,9 +35,9 @@ void setup() {
37 35
38 36 // Turn on vsync to prevent tearing
39 37 PGraphicsOpenGL pgl = (PGraphicsOpenGL) g; //processing graphics object
40   - GL gl = pgl.beginGL(); //begin opengl
  38 + GL2 gl = ((PJOGL)((PGraphicsOpenGL)g).beginPGL()).gl.getGL2(); //begin opengl
41 39 gl.setSwapInterval(0); //set vertical sync on
42   - pgl.endGL(); //end opengl
  40 + pgl.endPGL(); //end opengl
43 41
44 42 //size(1680, 1000, OPENGL);
45 43 pCamera = new PeasyCam(this, 0, -50, 0, 100);
@@ -107,7 +105,7 @@ void receive(byte[] data, String ip, int port) {
107 105 }
108 106
109 107 if (newImageQueue.size() > 0) {
110   - println("Buffer full, dropping frame!");
  108 + //println("Buffer full, dropping frame!");
111 109 return;
112 110 }
113 111
@@ -144,7 +142,7 @@ void drawGround() {
144 142
145 143 beginShape();
146 144 texture(groundTexture);
147   - textureMode(NORMALIZED);
  145 + textureMode(NORMAL);
148 146
149 147 vertex(0, .5, 0, 0, 0);
150 148 vertex(bound/tilefactor, .5, 0, 1, 0);
2  BlinkeyLight.pde
@@ -24,7 +24,7 @@ class BlinkeyLight {
24 24 fill(c);
25 25 scale(rad);
26 26 //ellipse(0,0,1.5,1.5);
27   - point(0,0);
  27 + point(0,0);
28 28 popMatrix();
29 29 }
30 30 }
1  BlinkeyLights.pde
@@ -10,7 +10,6 @@ class BlinkeyLights {
10 10 for (int light = lights_per_strip_ -1; light > 0; light--) {
11 11 for (int strip = 0; strip < strips_; strip++) {
12 12
13   -
14 13 float inclination = HALF_PI + (HALF_PI)*((float)light/lights_per_strip_);
15 14 float azimuth = (2*PI)*((float)strip/strips_);
16 15
4 DemoTransmitter.pde
@@ -9,10 +9,10 @@ class DemoTransmitter extends Thread {
9 9
10 10 for (int i = 0; i < imageData.length; i++) {
11 11 if (animationStep == i%10) {
12   - imageData[i] = color(255, 255, 255);
  12 + imageData[i] = color(255);
13 13 }
14 14 else {
15   - imageData[i] = color(0, 0, 0);
  15 + imageData[i] = color(0);
16 16 }
17 17 }
18 18

0 comments on commit 8908d38

Please sign in to comment.
Something went wrong with that request. Please try again.