Currently, I am in the process of converting a project I developed in Processing [Java Mode] to an online platform for web viewing. The project involves P3D rendering to showcase a 3D environment that allows for rotation and manipulation of three data sets (.tsv files) representing earthquake locations and sizes over three years. The code functions well in Java mode, but in JavaScript mode, it only displays a blank gray screen. I have ensured that the HTML for embedding the sketch in the canvas is correct and error-free, so I suspect an issue within the code that might not be compatible with JavaScript. Is it possible to run the PDE as Java without relying on Processing.js? Alternatively, can someone identify any compatibility issues with the Processing.js code?
For reference, here is the link to the non-functional sketch.
Any advice on how to proceed would be greatly appreciated. Thank you.
float dial = 0.0;
FloatTable data;
FloatTable data2;
float dataMin, dataMax;
int rowCount;
int currentColumn = 0;
int columnCount;
int yearMin, yearMax;
int[] years;
int yearInterval = 10;
int volumeInterval = 10;
int volumeIntervalMinor=5;
PImage bg;
PImage texmap;
PFont font;
PImage img, img2;
PImage imgTitle;
int sDetail = 35; // Sphere detail setting
float rotationX = 0;
float rotationY = 0;
float velocityX = 0;
float velocityY = 0;
float globeRadius = 750;
float pushBack = 0;
float[] cx, cz, sphereX, sphereY, sphereZ;
float sinLUT[];
float cosLUT[];
float SINCOS_PRECISION = 0.5;
int SINCOS_LENGTH = int(360.0 / SINCOS_PRECISION);
void setup() {
size(1300,1000, P3D);
textSize(100);
texmap = loadImage("img/world32k.jpg");
initializeSphere(sDetail);
setupstuff("2011.tsv");
}
void draw() {
background(0);
// drawTitle();
drawMain();
renderGlobe();
drawDial();
}
void setupstuff(String filename){
data = new FloatTable(filename);
rowCount=data.getRowCount();
columnCount = data.getColumnCount();
years = int(data.getRowNames());
yearMin = years[0];
yearMax = years[years.length - 1];
font = loadFont("Univers-Bold-12.vlw");
dataMin = 0;
dataMax = ceil( data.getTableMax()/volumeInterval)*volumeInterval;
img = loadImage("img/dialface.jpg");
img2 = loadImage("img/dial.png");
imgTitle = loadImage("Title.png");
imageMode(CENTER);
}
/* More lines of code copied from original text... */