Unfortunately, I've been a bit busy over the past few weeks and haven't had the opportunity to work much on the project. However, I plan to put aside this weekend for working on Mass Writing and hope to have an updated script by Sunday.
I also hope to have a good program completed properly as the requirement is for us to have a stand alone program separate from the one developed in the main text. I was thinking of a morphing program (one that takes two images and allows one to be transformed into the other through a seamless transition) although I fear that this may be too ambitious!
I need to experiment and develop a system for cross-fading, possibly using Processing's bitwise operations as described in Chapter 10 of Greenberg. The other requirement for a morphing program is warping, i.e. stretching areas of the first image to meet logically similar areas of the second image - synchronised with the cross-fading effect to give a smooth transition.
A fun weekend lies ahead...!
Thursday, March 26, 2009
Tuesday, January 20, 2009
Easiest Syntax?
Just wondering if I should show the syntax for declaring arrays as:
float[][] myArray;
myArray = new float[200][200];
or as:
float[][] myArray = new float[200][200];
I wonder what new students would find easier? Perhaps both?
float[][] myArray;
myArray = new float[200][200];
or as:
float[][] myArray = new float[200][200];
I wonder what new students would find easier? Perhaps both?
Sunday, January 11, 2009
Incomplete sketchy attempt...
OK, here's a sketchy attempt at my little bit of writing. By no means is this complete.. nowhere NEAR 2500 words! But at least its a start...
We saw on page xx the various uses of one-dimensional (1D) arrays. Now we are going to take this concept further and show how two-dimensional (2D) arrays can be used for computer graphics.
Firstly, let us describe what a 2D array is. Where a 1D array is basically a list of items of a similar type, a 2D array is best described as a table of items of a similar type. In terms of geometry, a 2D array can be thought of as a flat plane with an X and Y axis.
The uses of this in computing are quite wide and varied. Employing 2D arrays in computer graphics can be quite useful as a table can be useful for storing values and data relating to pixels on screen. The use of programming constructs such as loops allows for each element of the array to be processed individually as seen previously for 1D arrays on page xx. The difference for a 2D array is that access to the elements needs to move in both directions, i.e. horizontally as well as vertically. The way that this is done is described later.
Now we will look at the syntax for declaring arrays. We know that a 1D array is declared as follows:
int[] myArray = new int[size];
Similarly, a 2D array is declared as follows:
int[][] myArray = new int[sizeX][sizeY];
The difference here is that the 2D array has two subscripts, i.e. one to control the X coordinate and one to control the Y coordinate.
More to follow... I'll hopefully be able to post some code soon too.
We saw on page xx the various uses of one-dimensional (1D) arrays. Now we are going to take this concept further and show how two-dimensional (2D) arrays can be used for computer graphics.
Firstly, let us describe what a 2D array is. Where a 1D array is basically a list of items of a similar type, a 2D array is best described as a table of items of a similar type. In terms of geometry, a 2D array can be thought of as a flat plane with an X and Y axis.
The uses of this in computing are quite wide and varied. Employing 2D arrays in computer graphics can be quite useful as a table can be useful for storing values and data relating to pixels on screen. The use of programming constructs such as loops allows for each element of the array to be processed individually as seen previously for 1D arrays on page xx. The difference for a 2D array is that access to the elements needs to move in both directions, i.e. horizontally as well as vertically. The way that this is done is described later.
Now we will look at the syntax for declaring arrays. We know that a 1D array is declared as follows:
int[] myArray = new int[size];
Similarly, a 2D array is declared as follows:
int[][] myArray = new int[sizeX][sizeY];
The difference here is that the 2D array has two subscripts, i.e. one to control the X coordinate and one to control the Y coordinate.
More to follow... I'll hopefully be able to post some code soon too.
Tuesday, December 9, 2008
Processing
I've had the Processing book for about a week now. It arrived in the bookshop sooner than expected. I've been playing with 2D arrays and some basic code is shown below. This just draws a "gradient" type of effect as output:
/*
My First Experiment with 2D Arrays
Mark Moran
19-11-08
*/
float[][] myArray;
myArray = new float[200][200];
size(200, 200);
background(0);
for(int i=0; i<200; i++) {
for(int j=0; j<200; j++) {
myArray[i][j] = i;
}
}
for(int i=0; i<200; i++) {
for(int j=0; j<200; j++) {
stroke(myArray[i][j]);
point(i, j);
}
}
The stuff in the book about loading an image from a file and manipulating it appeals to me in particular. I feel a jigsaw type of application coming on! This would probably be more suitable for the main program, i.e. not the one which is given as a primary example to the student. For the latter, something more simple should suffice...
/*
My First Experiment with 2D Arrays
Mark Moran
19-11-08
*/
float[][] myArray;
myArray = new float[200][200];
size(200, 200);
background(0);
for(int i=0; i<200; i++) {
for(int j=0; j<200; j++) {
myArray[i][j] = i;
}
}
for(int i=0; i<200; i++) {
for(int j=0; j<200; j++) {
stroke(myArray[i][j]);
point(i, j);
}
}
The stuff in the book about loading an image from a file and manipulating it appeals to me in particular. I feel a jigsaw type of application coming on! This would probably be more suitable for the main program, i.e. not the one which is given as a primary example to the student. For the latter, something more simple should suffice...
Wednesday, November 19, 2008
Processing book
I've ordered the Processing book from Hodges & Figgis. Waterstones here in Dublin didn't seem to even stock it! It will take about three weeks to arrive as it is an American import.
Having said that I notice that Chunk 39 has no reference to the book so this leaves me free to do some writing anyway and I notice there are examples of 2D arrays in the Processing software itself.
Still not sure exactly what kind of stimulating graphical code I'm going to produce but it will be interesting to see if I can produce 3D effects from a 2D plane. Looking forward to this!
Having said that I notice that Chunk 39 has no reference to the book so this leaves me free to do some writing anyway and I notice there are examples of 2D arrays in the Processing software itself.
Still not sure exactly what kind of stimulating graphical code I'm going to produce but it will be interesting to see if I can produce 3D effects from a 2D plane. Looking forward to this!
Friday, November 14, 2008
Chosen chunk
I've chosen chunk 39 as multi-dimensional arrays are something that have always interested me due to their various uses. I'm waiting to see if I was the first to request this! I hope so :)
My thoughts based on the chunk description are that each referenced element in the 2D array could represent part of an image (or a pixel) and an interesting graphics program(s) could be developed to create some form of pattern...
I've also downloaded and installed Processing and am finding the examples quite interesting. The syntax looks easy enough and gives me hope that this project could be quite enjoyable!
My thoughts based on the chunk description are that each referenced element in the 2D array could represent part of an image (or a pixel) and an interesting graphics program(s) could be developed to create some form of pattern...
I've also downloaded and installed Processing and am finding the examples quite interesting. The syntax looks easy enough and gives me hope that this project could be quite enjoyable!
Thursday, November 13, 2008
Making a Start!
Well, here's my first blog entry for the OU Mass Writing project!
I'm off to seek out the Greenberg book in Waterstones this weekend (Saturday) so I hope to really get moving by next week.
I'm off to look at the Chunks now and try to come to a decision as soon as possible...
I'm off to seek out the Greenberg book in Waterstones this weekend (Saturday) so I hope to really get moving by next week.
I'm off to look at the Chunks now and try to come to a decision as soon as possible...
Subscribe to:
Posts (Atom)