Prior to the 19th century, complex woven designs were created by hand. Because of this, printed material came at a relatively high cost. In 1804, Joseph-Marie Jacquard invented the Jacquard loom which automated the production of patterned textiles . This loom in turn resulted in the modification of textile weaving from a ‘cottage industry’ run by close-knit families of skilled workers, to a focus of mass production on an industrial scale.
Not only did the Jacquard loom revolutionize the weaving industry, but it also created the foundation for future computer programmes. The ability to change the pattern of the loom’s weave by simply changing cards was an important precursor to the development of computer programming and data entry. Charles Babbage knew of Jacquard looms and planned to use the cards to store programs in his Analytical Engine. Also, a large punched-card-based data processing industry developed in the early 20th century, dominated by IBM, with its line of unit record equipment.
The gist of the above paragraphs shows the importance of appreciating art, through the lens of weaving in this case, as a science. By focusing on the automation of patterns of greater complexity, Joseph-Marie Jacquard unwittingly inspired the computer, and all other technologies that followed therefrom. With this in mind, we shall explore the mechanisms behind our first creative coding project.
Rudimental Elements of Project
In order to have our cube rotate like it does in the above presentation, we will make use of the following script. All in all, this script is quite brief, which is fair considering the task it has to fulfill.
FIRST LINE
this.transform.localScale = new Vector3(2.0f, 2.0f, 2.0f);
this refers to what the script is attached to, which is a cube in this case.
transform refers to the fact that we want to manipulate the position, rotation or scale of the object..
localScale refers to the dimensions of the cube, or rather the length, width and height.
Finally, on the right hand side of the equation we set the dimensions of the cube
SECOND LINE
Vector3 spinSpeed = new Vector3(1f, .1f, 1f);
This line of code sets the rotation speed of each dimension of the cube. I prefer a slow rotation in this case, while you might not. This line of code and the one above it is running within the start function. You can learn more about it here.
THIRD LINE
this and transform have already been discussed above.
Rotate, as is expected, is what makes the cube rotate in this case. This line of code is running with the update function. You can learn more about it here.
And there you have it! That is all the code needed to get the cube to rotate. We can play around with this script to get the cube to rotate differently, but the code would still maintain some of the lines given in this script. The entire script is presented below.
![](https://static.wixstatic.com/media/2be87c_23ffe2ed673f4a9490c349729fc55869~mv2.png/v1/fill/w_777,h_628,al_c,q_90,enc_auto/2be87c_23ffe2ed673f4a9490c349729fc55869~mv2.png)
Conclusion
The best part about working with scripts in unity would be that it is possible to understand what the code does after one gives a good look, in addition to looking at the documentation. Obviously, things can get quite complex, but that would depend on why you are using Unity in the first place. Last week, Unity was listed on the NYSE. This recent development can only lead one to wonder what this company has to offer going forward. Whatever that might be, I’d hazard a guess that it will be pretty exciting. Complement this article with the following video.
References
Jacquard Loom, ageofrevolution.com
The loom that changed the world--Jacquard loom: From weaving to computers,ghorbany.com
International Business Machines, wikipedia.com
Complexity theory as a context for Art Theory, PhilipGalanter.com
Why Art and Science are more closely related than you think, Forbes.com
Unity C# Scripting Tutorial, youtube.com
Kommentare