├── license.md ├── readme.md ├── vol1 └── no3 │ └── StructuredSquareSeriesInwards │ └── StructuredSquareSeriesInwards.pde └── vol2 └── no3 └── RandomSquares ├── RandomSquares.pde ├── Rosetta.pde └── Vernacular.pde /license.md: -------------------------------------------------------------------------------- 1 | All original code in this repository is available under the [MIT License](https://secure.wikimedia.org/wikipedia/en/wiki/Mit_license). Anything transcribed from code listings may be available under a different license. 2 | 3 | Copyright (c) 2012- Kyle McDonald 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Computer Graphics and Art 2 | 3 | Code listings, implementations, and translations of code in the "Computer Graphics And Art" magazine (1976-1978). 4 | 5 | PDFs of the original publication are available on [compart](http://dada.compart-bremen.de/search_all/Computer%20Graphics%20and%20Art) with an overview provided on [Rhizome](http://rhizome.org/editorial/2012/sep/25/prosthetic-knowledge-picks-computer-graphics-art-1/). 6 | 7 | ![Computer Graphics & Art](http://media.rhizome.org/blog/8808/pkgif.gif) -------------------------------------------------------------------------------- /vol1/no3/StructuredSquareSeriesInwards/StructuredSquareSeriesInwards.pde: -------------------------------------------------------------------------------- 1 | // From Computer Graphics and Art vol1 no3 pg 25 2 | // by Roger Coqart 3 | // "Structured Square Series -- Inwards", drawing 28 x 28 cm. 4 | // Other works in the series are "Horizontal Rows", "Outwards", as 5 | // well as the "Permutation" works. 6 | 7 | int side = 24; 8 | int lines = 8; 9 | int n = lines * 2 + 1; 10 | int margin = side / 2; 11 | int offset = side + margin; 12 | int canvas = (n + 1) * offset; 13 | boolean[] enabled = new boolean[lines]; 14 | 15 | void setup() { 16 | size(canvas, canvas); 17 | noLoop(); 18 | } 19 | 20 | void draw() { 21 | background(255); 22 | translate(side, side); 23 | for (int y = 0; y < n; y++) { 24 | for (int x = 0; x < n; x++) { 25 | // enable some lines 26 | int total = max(abs(y - lines), abs(x - lines)); 27 | for (int i = 0; i < lines; i++) { 28 | enabled[i] = i < total; 29 | } 30 | 31 | // shuffle the enabled lines 32 | for (int i = 0; i < lines; i++) { 33 | boolean swap = enabled[i]; 34 | int j = (int) random(lines); 35 | enabled[i] = enabled[j]; 36 | enabled[j] = swap; 37 | } 38 | 39 | // draw all enabled lines 40 | pushMatrix(); 41 | translate(x * offset, y * offset); 42 | rect(0, 0, side, side); 43 | if (enabled[0]) line(0, side / 2, side, side / 2); 44 | if (enabled[1]) line(side / 2, 0, side / 2, side); 45 | if (enabled[2]) line(0, 0, side, side); 46 | if (enabled[3]) line(0, side, side, 0); 47 | if (enabled[4]) line(0, side / 2, side / 2, 0); 48 | if (enabled[5]) line(side / 2, 0, side, side / 2); 49 | if (enabled[6]) line(side, side / 2, side / 2, side); 50 | if (enabled[7]) line(side / 2, side, 0, side / 2); 51 | popMatrix(); 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /vol2/no3/RandomSquares/RandomSquares.pde: -------------------------------------------------------------------------------- 1 | /* 2 | methods: 3 | 1. vernacular 4 | preserve the spirit of the image 5 | least work 6 | but the influence of the original tool is lost 7 | 2. rosetta 8 | preserve the spirit of the code itself 9 | connects old languages to new languages 10 | 3. revival 11 | write a parser to run the original code 12 | most work 13 | preserves everything but the output medium (plotter) 14 | */ 15 | 16 | /* 17 | // JOB 18 | // FOR RDMSQ 19 | *NONPROCESS PROGRAM 20 | *ONE WORD INTEGERS 21 | *LIST SOURCE PROGRAM 22 | *INCS(CARD,1443 PRINTER) 23 | C******************PROGRAMMED FOR COMPUTER GRAPHICS AND ART BY BILL KULOMYJEC 24 | DIMENSION A(4,2),B(4,2),AA(4,2),BB(4,2) 25 | C PROVIDE MEMORY FOR 2 SETS OF SQUARES, RANDOMIZE 26 | CALL RANST 27 | C DEFINE VARIABLES 28 | NUMX=5 29 | NUMY=7 30 | C BSS=THE SIZE OF THE SIDE OF THE SQUARE, SSPCT=THE PERCENT 31 | C OF THE SIZE OF THE INSIDE SQUARE 32 | BSS=1.25 33 | SSPCT=0.20 34 | HFBSS=BSS/2.0 35 | C VLIMIT IS THE MAXIMUM AMOUNT THE INNER SQUARE MAY VARY 36 | VLIMT=HFBSS-(BSS*SSPCT/2.0) 37 | C SET UP CORNERS OF BIG SQUARE 38 | A(1,1)= HFBSS 39 | A(1,2)= HFBSS 40 | A(2,1)=-HFBSS 41 | A(2,2)= HFBSS 42 | A(3,1)=-HFBSS 43 | A(3,2)=-HFBSS 44 | A(4,1)= HFBSS 45 | A(4,2)=-HFBSS 46 | C SCALE DOWN SMALL SQUARE BY SSPCT 47 | DO 100 J=1,4 48 | DO 100 K=1,2 49 | 100 B(J,K)=A(J,K)*SSPCT 50 | C INITIALIZE PLOTTER 51 | CALL HYPLT (0.,0.,0) 52 | C BEGIN DRAWING RANDOM SQUARE MODULES 53 | DO 200 J=1,NUMY 54 | YC=FLOAT(J-1)*BSS 55 | DO 200 K=1,NUMX 56 | XC=FLOAT(K-1)*BSS 57 | C ADJUST OUTER SQUARE TO RELATIVE LOCATION 58 | DO 201 L=1,4 59 | AA(L,1)=A(L,1)+XC 60 | AA(L,2)=A(L,2)+YC 61 | 201 CONTINUE 62 | C DETERMINE X AND Y VARIANCE BASED ON VLIMT 63 | XVAR=RANF(0)*VLIMT-(VLIMT/2.0) 64 | YVAR=RANF(0)*VLIMT-(VLIMT/2.0) 65 | C ADJUST INNER SQUARE TO RELATIVE LOCATION, ADD VARIANCE 66 | DO 202 M=1,4 67 | BB(M,1)=B(M,1)+XVAR+XC 68 | BB(M,2)=B(M,2)+YVAR+YC 69 | 202 CONTINUE 70 | C DETERMINE RANDOM NUMBER OF INTERVALS (BETWEEN 2 AND 10) 71 | NSPCS=9*RANF(D)+2 72 | C PLOT EACH MODULE 73 | DO 203 N=1,NSPCS 74 | C P CALCULATES RELATIVE SPACING ON NSPCS 75 | P=FLOAT(N-1)/(NSPCS-1) 76 | X=AA(4,1)+P*(BB(4,1)-AA(4,1)) 77 | Y=AA(4,2)+P*(BB(4,2)-AA(4,2)) 78 | C MOVE THE PEN TO THE LAST CORNER OF THE SQUARE 79 | CALL HYPLT (X,Y,2) 80 | C PLOT INTERMEDIATE SQUARES 81 | DO 300 I=1,4 82 | X=AA(I,1)+P*(BB(I,1)-AA(I,1)) 83 | Y=AA(I,2)+P*(BB(I,2)-AA(I,2)) 84 | 300 CALL HYPLT (X,Y,1) 85 | 203 CONTINUE 86 | 200 CONTINUE 87 | C TERMINATE 88 | CALL HYPLT (0.,0.,-1) 89 | CALL EXIT 90 | END 91 | 92 | FEATURES SUPPORTED 93 | NONPROCESS 94 | ONE WORD INTEGERS 95 | INCS 96 | 97 | CORE REQUIREMENTS FOR RDMSQ 98 | COMMON O INSKEL COMMON 0 VARIABLES 110 PROGRAM 444 99 | */ 100 | 101 | void setup() { 102 | size(500, 700); 103 | background(255); 104 | noLoop(); 105 | } 106 | 107 | void draw() { 108 | //vernacular(); 109 | rosetta(); 110 | } 111 | -------------------------------------------------------------------------------- /vol2/no3/RandomSquares/Rosetta.pde: -------------------------------------------------------------------------------- 1 | /* 2 | translation notes: 3 | * BASIC uses 1-indexed arrays, Java uses 0-indexed arrays 4 | * lines with //? have no corollary in this environment 5 | * with a few exceptions, there is no decorative whitespace in the original code 6 | * RANF(0) corresponds to random(1) 7 | * the HYPLT plotter interface is replaced with beginShape/endShape helper functions 8 | */ 9 | 10 | void rosetta() { 11 | // ******************PROGRAMMED FOR COMPUTER GRAPHICS AND ART BY BILL KULOMYJEC 12 | float[][] 13 | A = new float[4][2], 14 | B = new float[4][2], 15 | AA = new float[4][2], 16 | BB = new float[4][2]; 17 | // PROVIDE MEMORY FOR 2 SETS OF SQUARES, RANDOMIZE 18 | randomSeed(0); //CALL RANST 19 | // DEFINE VARIABLES 20 | int NUMX=5; 21 | int NUMY=7; 22 | // BSS=THE SIZE OF THE SIDE OF THE SQUARE, SSPCT=THE PERCENT 23 | // OF THE SIZE OF THE INSIDE SQUARE 24 | float BSS=1.25; 25 | float SSPCT=0.20; 26 | float HFBSS=BSS/2.0; 27 | // VLIMIT IS THE MAXIMUM AMOUNT THE INNER SQUARE MAY VARY 28 | float VLIMT=HFBSS-(BSS*SSPCT/2.0); 29 | // SET UP CORNERS OF BIG SQUARE 30 | A[0][0]= HFBSS; 31 | A[0][1]= HFBSS; 32 | A[1][0]=-HFBSS; 33 | A[1][1]= HFBSS; 34 | A[2][0]=-HFBSS; 35 | A[2][1]=-HFBSS; 36 | A[3][0]= HFBSS; 37 | A[3][1]=-HFBSS; 38 | // SCALE DOWN SMALL SQUARE BY SSPCT 39 | for(int J=0;J<4;J++) { 40 | for(int K=0;K<2;K++) { 41 | B[J][K]=A[J][K]*SSPCT; 42 | } 43 | } 44 | // INITIALIZE PLOTTER 45 | HYPLT(0.,0.,0); 46 | // BEGIN DRAWING RANDOM SQUARE MODULES 47 | for(int J=0;J