russell
YaBB Newbies
Offline
Posts: 12
Re: P5 Sunflow large printing
Reply #2 - Oct 30th , 2008, 8:16pm
I feel like that might bypass the the Sunflow rayracer. Is it possible to render out the finished image to a file rather than displaying it on the screen, which restricts the size? Here is the code if my explanation isn't great. import hipstersinc.sunflow.*; import hipstersinc.sunflow.shader.*; import hipstersinc.*; int sz = 20; int zSize = 19; int zLevel = -350; int[][] data; String[] lines; void setup() { size(1400,600,"hipstersinc.P5Sunflow"); background(255); noStroke(); lines = loadStrings("data.txt"); data = new int[lines.length][lines[0].length()/2+1]; for(int i=0;i<lines.length;i++){ int[] temp = int(split(lines[i], ",")); for(int x=0; x<temp.length; x++){ data[i][x]=temp[x]; } } noLoop(); } void draw(){ background(255); setupCamera(); //camera(-200, -200, 500, width/2, height/2, 100,-1, 1.0, 0.0); camera(-700,-200, 700,800, 400,300 ,0, 1.0, 0.0); int[][] life= new int[20][20]; for(int z = 0; z< 65; z++){ int xpos = -1; for(int a =0; a<data[z].length; a++){ if(a % 20 == 0){ xpos+=1; } life[xpos][a%20] = data[z][a]; } for(int i=0; i<life[0].length; i++){ for(int j=0; j<life[0].length; j++){ fill(30+z*2,z*3,210-z*2); if(life[i][j]==1){ pushMatrix(); translate(sz * i , sz * j, zLevel); box(sz,sz,zSize); popMatrix(); } } } zLevel += zSize; } saveFrame("newBig3.tif"); } void setupCamera() { P5Sunflow sunflow = (P5Sunflow) g; sunflow.camera.setType(SunflowCamera.PINHOLE); }