class Solid{ float atomSize; float detail; int renderingIterations; int renderingLimit; int iterations; boolean finished; Transform transform; Shader shader; //----------- Solid(){ atomSize = 2; finished = false; detail = 0.1; renderingLimit = 1000000; renderingIterations = 1000; iterations = 0; transform = new Transform(); setShader( shaders[0] ); } //----------- void setShader(Shader s){ shader = s; } //----------- void parse(String[] strs, int s){} //-------------------- void fillNumericArguments(String expression,float[] arguments){ String[] args = trim(expression).split(","); for( int i=0 ; i=width || j<0 || j>=height ) continue; float zIntersect = sphereIntersect(i, j); if( zBuffer[i][j] < zIntersect ){ zBuffer[i][j] = max( zBuffer[i][j], zIntersect ); normalBuffer[i][j] = new Vector3D(i-pos.x,j-pos.y,zIntersect-pos.z); shaderBuffer[i][j] = shader; localCoordBuffer[i][j] = pos; } } } //----------- float sphereIntersect(float i, float j){ float zSquared = radius*radius - (i-pos.x)*(i-pos.x) - (j-pos.y)*(j-pos.y); if(zSquared<0) return minZBuffer; float zIntersect = sqrt(zSquared); return zIntersect+pos.z; } } //========================================================== //==========================================================