This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fiskur.p5; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import android.app.Activity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.processing.wiki.triangulate.*; | |
int mPointsCount = 125; | |
ArrayList<PVector> points = new ArrayList<PVector>(); | |
ArrayList triangles = new ArrayList(); | |
void setup(){ | |
size(300, 400); | |
frameRate(30); | |
noStroke(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PImage backgroundImage; | |
Point gStart = new Point(0, 0); | |
Point gEnd = new Point(160, 300); | |
Point aPoint = new Point(185, 80); | |
Point bPoint = new Point(185, 130); | |
Point cPoint = new Point(185, 180); | |
Point dPoint = new Point(185, 230); | |
Point ePoint = new Point(185, 280); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int getTriangleArea(Triangle t){ | |
int v1 = distance(t.p1.x, t.p1.y, t.p2.x, t.p2.y); | |
int v2 = distance(t.p2.x, t.p2.y, t.p3.x, t.p3.y); | |
int v3 = distance(t.p3.x, t.p3.y, t.p1.x, t.p1.y); | |
int s = (v1 + v2 + v3) / 2; | |
return (int) sqrt(s * (s - v1) * (s - v2) * (s - v3)); | |
} | |
int distance(float x1, float y1, float x2, float y2){ | |
return (int) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fiskur.screenburnfix; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.app.Activity; | |
import android.graphics.Color; | |
import android.view.View; | |
import android.view.Window; | |
import android.view.WindowManager; | |
import android.widget.LinearLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PVector[] v = new PVector[]{ | |
new PVector(46,-6,78), | |
new PVector(-43,-6,78), | |
new PVector(1,25,-12), | |
new PVector(-88,10,-78), | |
new PVector(94,10,-78), | |
new PVector(-130,-6,30), | |
new PVector(133,-6,30), | |
new PVector(127,-6,-57), | |
new PVector(-133,-6,-57), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PVector[] v = new PVector[]{ | |
new PVector(46,-6,78), | |
new PVector(-43,-6,78), | |
new PVector(1,25,-12), | |
new PVector(-88,10,-78), | |
new PVector(94,10,-78), | |
new PVector(-130,-6,30), | |
new PVector(133,-6,30), | |
new PVector(127,-6,-57), | |
new PVector(-133,-6,-57), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Object name: CORIOLIS | |
PVector[] CORIOLISpoints = new PVector[]{ | |
new PVector(-500,750,500), | |
new PVector(500,750,500), | |
new PVector(500,750,-500), | |
new PVector(-500,750,-500), | |
new PVector(0,0,-1000), | |
new PVector(-1000,0,0), | |
new PVector(0,0,1000), | |
new PVector(1000,0,0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PShape shipShape; | |
int shipIndex = 0; | |
void setup(){ | |
size(800, 800, P3D); | |
frameRate(30); | |
smooth(); | |
//Spoof mousePressed event to get first ship: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fiskur.androidcolours; | |
import java.awt.Color; | |
import java.awt.Component; | |
import java.awt.Font; | |
import java.util.Scanner; | |
import javax.swing.DefaultListModel; | |
import javax.swing.JLabel; | |
import javax.swing.JList; | |
import javax.swing.ListCellRenderer; |
OlderNewer