hey friends
this computer graphics practicals was the time of my educational time , I am sharing with you.
i am software developer for more query contect on my e-mail id abhi.smarta02@gmail.com
Scientific Computing with Python Webinar March 19: 3D Visualization with MayaviEnthought, Inc.
In this webinar, Didrik Pinte provides an introduction to MayaVi, the 3D interactive visualization library for the open source Enthought Tool Suite. These tools provide scientists and engineers a sophisticated Python development framework for analysis and visualization.
This book is intended for education and fun. Python is an amazing, text-based coding language, perfectly suited for children older than the age of 10. The Standard Python library has a module called Turtle which is a popular way to introduce programming to kids. This library enables children to create pictures and shapes by providing them with a virtual canvas. With the Python Turtle library, you can create nice animation projects using images that are taken from the internet, scaled-down stored as a gif-files download to the projects. The book includes 19 basic lessons with examples that introduce to the Python codes through Turtle library which is convenient to the school students of 10+years old. The book has also a lot of projects that show how to make different animations with Turtle graphics: games, applications to math, physics, and science.
hey friends
this computer graphics practicals was the time of my educational time , I am sharing with you.
i am software developer for more query contect on my e-mail id abhi.smarta02@gmail.com
Scientific Computing with Python Webinar March 19: 3D Visualization with MayaviEnthought, Inc.
In this webinar, Didrik Pinte provides an introduction to MayaVi, the 3D interactive visualization library for the open source Enthought Tool Suite. These tools provide scientists and engineers a sophisticated Python development framework for analysis and visualization.
This book is intended for education and fun. Python is an amazing, text-based coding language, perfectly suited for children older than the age of 10. The Standard Python library has a module called Turtle which is a popular way to introduce programming to kids. This library enables children to create pictures and shapes by providing them with a virtual canvas. With the Python Turtle library, you can create nice animation projects using images that are taken from the internet, scaled-down stored as a gif-files download to the projects. The book includes 19 basic lessons with examples that introduce to the Python codes through Turtle library which is convenient to the school students of 10+years old. The book has also a lot of projects that show how to make different animations with Turtle graphics: games, applications to math, physics, and science.
We define what it means for a function to have a maximum or minimum value, and explain the Extreme Value Theorem, which indicates these maxima and minima must be there under certain conditions.
Fermat's Theorem says that at differentiable extreme points, the derivative should be zero, and thus we arrive at a technique for finding extrema: look among the endpoints of the domain of definition and the critical points of the function.
There's also a little digression on Fermat's Last theorem, which is not related to calculus but is a big deal in recent mathematical history.
We define what it means for a function to have a maximum or minimum value, and explain the Extreme Value Theorem, which indicates these maxima and minima must be there under certain conditions.
Fermat's Theorem says that at differentiable extreme points, the derivative should be zero, and thus we arrive at a technique for finding extrema: look among the endpoints of the domain of definition and the critical points of the function.
There's also a little digression on Fermat's Last theorem, which is not related to calculus but is a big deal in recent mathematical history.
Introduction to Factorization Machines model with an example. Motivations - why you should have it in your toolbox, model and it expressiveness, use case for context-aware recommendations and Field-Aware Factorization Machines.
I survey three approaches for data visualization in R: (i) the built-in base graphics functions, (ii) the ggplot2 package, and (iii) the lattice package. I also discuss some methods for visualizing large data sets.
Steffen Rendle, Research Scientist, Google at MLconf SFMLconf
Abstract:
Developing accurate recommender systems for a specific problem setting seems to be a complicated and time-consuming task: models have to be defined, learning algorithms derived and implementations written. In this talk, I present the factorization machine (FM) model which is a generic factorization approach that allows to be adapted to problems by feature engineering. Efficient FM learning algorithms are discussed among them SGD, ALS/CD and MCMC inference including automatic hyperparameter selection. I will show on several tasks, including the Netflix prize and KDDCup 2012, that FMs are flexible and generate highly competitive accuracy. With FMs these results can be achieved by simple data preprocessing and without any tuning of regularization parameters or learning rates.
Homomorphic Lower Digit Removal and Improved FHE Bootstrapping by Kyoohyung Hanvpnmentor
Kyoohyung Han is a PhD student in the Department of Mathematical Science at the Seoul National University in Korea. These are the slides from his presentation at EuroCrypt 2018.
Slides for my Talk at PyConDE/PyData Berlin 2019 https://de.pycon.org/program/pydata-rrlryg-a-bayesian-workflow-with-pymc-and-arviz-corrie-bartelheimer/
Resources:
Richard McElreath "Statistical Rethinking": https://xcelab.net/rm/statistical-rethinking/
Statistical Rethinking Port to PyMC3: https://github.com/pymc-devs/resources/tree/master/Rethinking
Prior Recommendation by Stan Team: https://github.com/stan-dev/stan/wiki/Prior-Choice-Recommendations
Michael Betancourt Case Studies: https://betanalpha.github.io/writing/
Berlin Bayesian Meetup Group: https://www.meetup.com/de-DE/BerlinBayesians/
Code and Notebook:
https://github.com/corriebar/Bayesian-Workflow-with-PyMC
We define what it means for a function to have a maximum or minimum value, and explain the Extreme Value Theorem, which indicates these maxima and minima must be there under certain conditions.
Fermat's Theorem says that at differentiable extreme points, the derivative should be zero, and thus we arrive at a technique for finding extrema: look among the endpoints of the domain of definition and the critical points of the function.
There's also a little digression on Fermat's Last theorem, which is not related to calculus but is a big deal in recent mathematical history.
We define what it means for a function to have a maximum or minimum value, and explain the Extreme Value Theorem, which indicates these maxima and minima must be there under certain conditions.
Fermat's Theorem says that at differentiable extreme points, the derivative should be zero, and thus we arrive at a technique for finding extrema: look among the endpoints of the domain of definition and the critical points of the function.
There's also a little digression on Fermat's Last theorem, which is not related to calculus but is a big deal in recent mathematical history.
Introduction to Factorization Machines model with an example. Motivations - why you should have it in your toolbox, model and it expressiveness, use case for context-aware recommendations and Field-Aware Factorization Machines.
I survey three approaches for data visualization in R: (i) the built-in base graphics functions, (ii) the ggplot2 package, and (iii) the lattice package. I also discuss some methods for visualizing large data sets.
Steffen Rendle, Research Scientist, Google at MLconf SFMLconf
Abstract:
Developing accurate recommender systems for a specific problem setting seems to be a complicated and time-consuming task: models have to be defined, learning algorithms derived and implementations written. In this talk, I present the factorization machine (FM) model which is a generic factorization approach that allows to be adapted to problems by feature engineering. Efficient FM learning algorithms are discussed among them SGD, ALS/CD and MCMC inference including automatic hyperparameter selection. I will show on several tasks, including the Netflix prize and KDDCup 2012, that FMs are flexible and generate highly competitive accuracy. With FMs these results can be achieved by simple data preprocessing and without any tuning of regularization parameters or learning rates.
Homomorphic Lower Digit Removal and Improved FHE Bootstrapping by Kyoohyung Hanvpnmentor
Kyoohyung Han is a PhD student in the Department of Mathematical Science at the Seoul National University in Korea. These are the slides from his presentation at EuroCrypt 2018.
Slides for my Talk at PyConDE/PyData Berlin 2019 https://de.pycon.org/program/pydata-rrlryg-a-bayesian-workflow-with-pymc-and-arviz-corrie-bartelheimer/
Resources:
Richard McElreath "Statistical Rethinking": https://xcelab.net/rm/statistical-rethinking/
Statistical Rethinking Port to PyMC3: https://github.com/pymc-devs/resources/tree/master/Rethinking
Prior Recommendation by Stan Team: https://github.com/stan-dev/stan/wiki/Prior-Choice-Recommendations
Michael Betancourt Case Studies: https://betanalpha.github.io/writing/
Berlin Bayesian Meetup Group: https://www.meetup.com/de-DE/BerlinBayesians/
Code and Notebook:
https://github.com/corriebar/Bayesian-Workflow-with-PyMC
I wanted to change the cloudsrectangles into an actuall image it do.pdffeelinggifts
I wanted to change the clouds/rectangles into an actuall image it doesnt matter the image.
import javax.swing.*;
import java.awt.*;
/**
* Created by Thomas on 11/27/2016.
*/
public class Renderer extends JPanel{
//private static final long serialVersionUID = 1L;
protected void paintComponent(Graphics g) {
Main.main.repaint(g);
}
public static int clamp(int greenValue, int i, int j) {
// TODO Auto-generated method stub
return 0;
}
}
OTHER PART:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.*;
/**
* Created by Thomas on 11/27/2016.
*/
public class Main implements ActionListener, KeyListener{
public static Main main;
public final int WIDTH = 1400;
public final int HEIGHT = 600;
public HUD Hud;
public Renderer renderer;
public Rectangle character;
public ArrayList cloud;
public Random rand;
public boolean start = false, gameover = false;
public int tick;
public Main() {
JFrame jFrame = new JFrame();
Timer timer = new Timer(20, this);
renderer = new Renderer();
rand = new Random();
jFrame.setTitle(\"Example\");
jFrame.add(renderer);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setSize(WIDTH, HEIGHT);
jFrame.addKeyListener(this);
jFrame.setVisible(true);
cloud = new ArrayList();
character = new Rectangle(200, 220, 20, 20);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
timer.start();
}
public void repaint(Graphics g) {
g.setColor(Color.black);
g.fillRect(0,0, WIDTH, HEIGHT);
g.setColor(Color.blue);
g.fillRect(0, HEIGHT - 100, WIDTH, 100);
g.setColor(Color.green);
g.fillRect(character.x, character.y, character.width, character.height);
if (character.y >= HEIGHT - 100 || character.y < 0) {
gameover = true;
}
for (Rectangle rect : cloud) {
g.setColor(Color.white);
g.fillRect(rect.x, rect.y, rect.width, rect.height);
}
g.setColor(Color.WHITE);
g.setFont(new Font(\"Times New Roman\", 1 ,100));
if (!start) {
g.drawString(\"Press to start!\", 450, HEIGHT / 2);
}
else if (gameover) {
g.drawString(\"Game Over!\", 450, HEIGHT / 2);
}
}
public void addCloud(boolean start) {
int width = 400;
int height = 200;
if (start) {
cloud.add(new Rectangle(WIDTH + width + cloud.size() * 300, rand.nextInt(HEIGHT-120),
80, 100));
}
else {
cloud.add(new Rectangle(cloud.get(cloud.size() - 1).x + 300, rand.nextInt(HEIGHT-120), 80,
100));
}
}
public void flap() {
if (gameover) {
character = new Rectangle(300, 400, 40, 40);
cloud.clear();
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
gameover = false;
}
if (!start) {
start = true;
}
else if (!gameover) {
character.y -= 70;
tick = 0;
}
}
@Override
public void actionPerformed(ActionEvent e) {
int speed = 15;
//System.out.println(\"Space\");
if (start) {
for (int i = 0; i .
C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
This reference will take you through simple and practical approach while learning C++ Programming language.
MATLAB is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages
Following are the changes mentioned in bold in order to obtain the r.pdfanithareadymade
Following are the changes mentioned in bold in order to obtain the required result and stop
scrolling in the background.
#include \"SDL/SDL.h\"
#include
//The attributes of the screen can be defined as follows
const int SCN_WIDTH = 640;
const int SCN_HEIGHT = 480;
const int SCN_BPP = 32;
//BPP defines bits per pixel
SDL_Surface* Background = NULL;
SDL_Surface* SpriteImage = NULL;
SDL_Surface* Backbuffer = NULL;
int SpriteFrame = 0;
int FrameCounter = 0;
const int MaxSpriteFrame = 12;
const int FrameDelay = 2;
int BackgroundX = 0;
SDL_Surface* LoadImage(char* fileName);
bool LoadFiles();
void FreeFiles();
void DrawImage(SDL_Surface* image, SDL_Surface* destSurface, int x, int y);
void DrawImageFrame(SDL_Surface* image, SDL_Surface* destSurface, int x, int y, int width,
int height, int frame);
bool ProgramIsRunning();
int main(int argc, char* args[])
{
if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
{
printf(\"Failed to initialize SDL!\ \");
return 0;
}
Backbuffer = SDL_SetVideoMode(800, 600, 32, SDL_SWSURFACE);
SDL_WM_SetCaption(\"Image Animation\", NULL);
if(!LoadFiles())
{
printf(\"Failed to load all files!\ \");
FreeFiles();
SDL_Quit();
return 0;
}
while(ProgramIsRunning())
{
//Update\'s the sprites frame
FrameCounter++;
if(FrameCounter > FrameDelay)
{
FrameCounter = 0;
SpriteFrame++;
}
if(SpriteFrame > MaxSpriteFrame)
SpriteFrame = 0;
//Background scrolling can be removed from this position
//Render the scene
DrawImage(Background,Backbuffer, BackgroundX, 0);
DrawImage(Background,Backbuffer, BackgroundX+800, 0);
DrawImageFrame(SpriteImage, Backbuffer, 350,250, 150, 120, SpriteFrame);
SDL_Delay(20);
SDL_Flip(Backbuffer);
}
FreeFiles();
SDL_Quit();
return 0;
}
SDL_Surface* LoadImage(char* fileName)
{
SDL_Surface* imageLoaded = NULL;
SDL_Surface* processedImage = NULL;
imageLoaded = SDL_LoadBMP(fileName);
if(imageLoaded != NULL)
{
processedImage = SDL_DisplayFormat(imageLoaded);
SDL_FreeSurface(imageLoaded);
if(processedImage != NULL)
{
//Here we map the color key
Uint32 colorKey = SDL_MapRGB(processedImage->format, 0, 0xFF, 0xFF);
//Now, set all the pixels of color R 0,G 0*FF,B 0*FF to be transparent
SDL_SetColorKey(processedImage, SDL_SRCCOLORKEY, colorKey);
}
}
return processedImage;
}
bool LoadFiles()
{
Background = LoadImage(\"graphics/background.bmp\");
if(Background == NULL)
return false;
SpriteImage = LoadImage(\"graphics/bat.bmp\");
//The file should be preloaded and linked with the required libraries in SDL
if(SpriteImage == NULL)
return false;
else
return true;
}
void FreeFiles()
{
SDL_FreeSurface(Background);
SDL_FreeSurface(SpriteImage);
}
void DrawImage(SDL_Surface* image, SDL_Surface* destSurface, int x, int y)
//A temporary rectangle is used to hold the offsets
{
SDL_Rect destRect;
//Giving the offsets to the rectangle
destRect.x = x;
destRect.y = y;
//Blit the surface
SDL_BlitSurface(image, NULL, destSurface, &destRect);
}
//Here, we need to start the main function:
int main(int argc,char** args)
//Now, initialize all SDL subsystems
if .
Below are questions that use the following image class- import assert.pdfrdzire2014
Below are questions that use the following image class:
import assert from "assert";
import { exec } from "child_process";
import fs from "fs";
import os from "os";
import path from "path";
import tmp from "tmp";
import { PNG } from "pngjs";
const IMAGES_FOLDER = path.resolve(process.cwd(), "images");
const IMAGE_GALLERY = fs.readdirSync(IMAGES_FOLDER).map(p =>
path.join(IMAGES_FOLDER, p));
type ImageName = "art" | "bike" | "car" | "dog" | "food" | "landscape" | "pencils" | "pottery" |
"tomato";
function assertSupportedType(filePath: string) {
assert(filePath.endsWith("png"), "Image must end in `.png`.");
}
const CHANNEL_NAMES = ["red", "green", "blue"];
function assertValidColor(color: Color) {
assert(color.length === 3);
CHANNEL_NAMES.forEach((channel, i) => {
assert(Number.isInteger(color[i]), `The ${channel} channel of the color must be an integer.`);
assert(0 <= color[i], `The ${channel} channel of the color must be at least 0.`);
assert(color[i] <= 255, `The ${channel} channel of the color must be at most 255.`);
});
}
function assertValidWidthAndHeight(width: number, height: number) {
assert(Number.isInteger(width), "Image width must be an integer.");
assert(Number.isInteger(height), "Image height must be an integer.");
assert(width > 0, "Image width must be greater than 0.");
assert(height > 0, "Image height must be greater than 0.");
assert(width < 5000, "Image width must be less than 5000.");
assert(height < 5000, "Image height must be less than 5000.");
}
export type Color = number[];
export const COLORS = {
WHITE: [255, 255, 255],
BLACK: [0, 0, 0],
RED: [255, 0, 0],
GREEN: [0, 255, 0],
BLUE: [0, 0, 255],
AQUA: [0, 255, 255],
YELLOW: [255, 255, 0],
MAGENTA: [255, 0, 255],
};
export class Image {
/**
* Loads an image from the preselected gallery of images into memory as an `Image` object.
* If no name is given, this function selects one at random.
* @param name The name of the image from the gallery
* @returns An image in the gallery as an Image object.
*/
static loadImageFromGallery(name?: ImageName): Image {
return name
? Image.loadImageFromFile(path.resolve(IMAGES_FOLDER, name + ".png"))
: Image.loadImageFromFile(IMAGE_GALLERY[Math.floor(Math.random() *
IMAGE_GALLERY.length)]);
}
/**
* Loads an image from the file system into memory as an `Image` object.
* @param image Path to a PNG, JPG, JPEG file
* @returns The file represented as an `Image` object.
*/
static loadImageFromFile(filePath: string): Image {
assertSupportedType(filePath);
if (!fs.existsSync(filePath)) {
throw new Error(`Unable to locate file: \`${filePath}\``);
}
fs.accessSync(filePath, fs.constants.R_OK);
const png = PNG.sync.read(fs.readFileSync(filePath));
return new Image(png.width, png.height, Uint8ClampedArray.from(png.data));
}
/**
* Creates a new image and sets each pixel to a default color.
* @param width The width of the image
* @param height The height of the image
* @param fillColor The color to set each pixel as
*/
static create(width: number, height: n.
Nous entendons aujourd’hui parler de Deep Learning un peu partout : reconnaissance d’images, de sons, génération de textes, etc. Suite aux récentes annonces sur Android Neural Network API et TensorFlowLite et à la release du framework CoreML d’Apple, tout nous pousse vers le “on-device intelligence”.
Bien que les techniques et frameworks soient en train de se démocratiser, il reste difficile d’en voir les applications concrètes en entreprise, et encore moins sur des applications mobiles. Nous avons donc décidé de construire un Proof Of Concept pour relever les défis du domaine.
A travers une application mobile à but éducatif, utilisant du Deep Learning pour de la reconnaissance d’objets, nous aborderons les impacts de ce type de modèles sur les smartphones, l’architecture pour l’entraînement et le déploiement de modèles sur un service Cloud, ainsi que la construction de l’application mobile avec les dernières nouveautés annoncées.
I am Tim D. I am a Computer Network Assignments Expert at computernetworkassignmenthelp.com. I hold a Master's in Computer Science from, West Virginia University, USA. I have been helping students with their assignments for the past 13 years. I solve assignments related to the Computer Network.
Visit computernetworkassignmenthelp.com or email support@computernetworkassignmenthelp.com.
You can also call on +1 678 648 4277 for any assistance with the Computer Network Assignments.
The documentation for an assignment completed for a first-year university subject whereby a personal portfolio was designed and developed using HTML5 and CSS3.
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Mansi Shah
This study examines cattle rearing in urban and rural settings, focusing on milk production and consumption. By exploring a case in Ahmedabad, it highlights the challenges and processes in dairy farming across different environments, emphasising the need for sustainable practices and the essential role of milk in daily consumption.
White wonder, Work developed by Eva TschoppMansi Shah
White Wonder by Eva Tschopp
A tale about our culture around the use of fertilizers and pesticides visiting small farms around Ahmedabad in Matar and Shilaj.
Book Formatting: Quality Control Checks for DesignersConfidence Ago
This presentation was made to help designers who work in publishing houses or format books for printing ensure quality.
Quality control is vital to every industry. This is why every department in a company need create a method they use in ensuring quality. This, perhaps, will not only improve the quality of products and bring errors to the barest minimum, but take it to a near perfect finish.
It is beyond a moot point that a good book will somewhat be judged by its cover, but the content of the book remains king. No matter how beautiful the cover, if the quality of writing or presentation is off, that will be a reason for readers not to come back to the book or recommend it.
So, this presentation points designers to some important things that may be missed by an editor that they could eventually discover and call the attention of the editor.
Dive into the innovative world of smart garages with our insightful presentation, "Exploring the Future of Smart Garages." This comprehensive guide covers the latest advancements in garage technology, including automated systems, smart security features, energy efficiency solutions, and seamless integration with smart home ecosystems. Learn how these technologies are transforming traditional garages into high-tech, efficient spaces that enhance convenience, safety, and sustainability.
Ideal for homeowners, tech enthusiasts, and industry professionals, this presentation provides valuable insights into the trends, benefits, and future developments in smart garage technology. Stay ahead of the curve with our expert analysis and practical tips on implementing smart garage solutions.
Expert Accessory Dwelling Unit (ADU) Drafting ServicesResDraft
Whether you’re looking to create a guest house, a rental unit, or a private retreat, our experienced team will design a space that complements your existing home and maximizes your investment. We provide personalized, comprehensive expert accessory dwelling unit (ADU)drafting solutions tailored to your needs, ensuring a seamless process from concept to completion.
Hello everyone! I am thrilled to present my latest portfolio on LinkedIn, marking the culmination of my architectural journey thus far. Over the span of five years, I've been fortunate to acquire a wealth of knowledge under the guidance of esteemed professors and industry mentors. From rigorous academic pursuits to practical engagements, each experience has contributed to my growth and refinement as an architecture student. This portfolio not only showcases my projects but also underscores my attention to detail and to innovative architecture as a profession.
1. //OLIVIA MEREDITH - 13510110 - BOND UNIVERSITY
//MMDE11-300_173 (SKETCHING WITH CODE)
//ASSIGNMENT #2 - PROCEDURAL ARTWORK
//NOTE: Minim (an audio library that provides the ability to work with sound) is utilised in this code
//for the full experience, it's recommended that this code is played with sound on
//setting up the capacity to interact with audio files
import ddf.minim.*; //imports minim library which enables interaction with audio files
Minim minim;//loading class of minim
AudioPlayer BGBeats;//similar to declaring a PImage for loading but for an audio file - the background beats
import processing.pdf.*; //imports library for print to pdf functionality
//declaring image variables (reserving space in memory)
PImage Face;//symmetrical face illustration - 1040x670
PImage ThirdEye;//single eye with triangle on top illustration - 800x800
PImage ThirdEyeTri;//eye in triangle with flowers illustration - 720x720
//background related variables
PImage TriBG;//loads the triangle background image - 1920x1080
PImage StripeyBG;//loads the pink and dark brown stripey background image formed by TriBG - 1920x1080
float BGy;//variable of type float used for TriBG's downward movement along the y-axis
float speed = 30;//larger number = TriBG to move faster + bigger little triangles between columns
color c1[] = {#88668E,#5ACA8D,#EACA44,#E8CCB4};//[0] is purple, [1] is green, [2] is yellow, [3] is cream
float ctransition = 0;//for main tree - declaring a variable of type float and assigning a value of 0 for the amount of lerp for colour transtions
int transDir = 1;//direction manager for colour lerping / transitions
float ctransition1 = 0;//for all other uses - declaring a variable of type float and assigning a value of 0 for the amount of lerp for colour transtions
int transDir1 = 1;//direction manager for colour lerping / transitions
float r1 = 0;//first round of concave and convex flashing bubbles
float r2 = 0;//second round of concave and convex flashing bubbles
float r3 = 0;//third round of concave and convex flashing bubbles
2. int iR = 0;//used for yellow 90 degree rotating "trees"
int rectangleHeight = 50;//variable of type integer to increase height of the vertical green rectangles coming down from y=0
int rectangleHeight1 = 50;//variable of type integer to increase height of the vertical cream rectangles coming down from y=0
int thirdEyeSize = 100;//variable of type integer with 100 as the starting size of the image, used for the ThirdEye growing in size
int thirdEyeTSize = 200;//variable of type integer with 200 as the starting size of the image, used for the ThirdEyeTri growing in size
int shrinkOrGrow = 0;//variable of type integer used for the pulsating effect for ThirdEye
//an array of the string data type (char), then referenced by in index and the random() function
String [] words = {"enhanced", "high", "conscious", "realisation", "slow vibration", "we are all one", "energy condensed",
"life is only a dream", "the imagination of ourselves", "keep it in mind", "dreaming again",
"grinning wide", "comforting", "warm and wild eyes", "tumbling", "rising up", "wiping the webs",
"in... out...", "stuck in my head","good to see you again", "prying open my third eye", "a trail of smoke and reason"}; //words from Tool's song "Third Eye"
void setup()
{
//size(9933, 7016, PDF, "Final.pdf");//A1 print resolution
size(1920,1080);//specifies size of canvas - 1920x1080
minim = new Minim(this);//passes this to minim so it can load files from the data directory
BGBeats = minim.loadFile("Papercut_TheBlock41.mp3");//loads an audio file and assigns it to "BGBeats" - https://soundcloud.com/otodayo/papercut-the-
block (royalty free)
BGBeats.play();//audio file will play
TriBG = loadImage("TriangleBG.png");//loads the triangle background image - 1920x1080
StripeyBG = loadImage("StripeyBG.png");//loads the pink and dark brown stripey background image formed by TriBG - 1920x1080
Face = loadImage("Face_S.png");//symmetrical face illustration - 1040x670
ThirdEye = loadImage("ThirdEye.png");//single eye with triangle on top illustration - 800x800
ThirdEyeTri = loadImage("ThirdEye_Detailed.png");//eye in triangle with flowers illustration - 720x720
//smooth(5);//anti-aliasing although a strength of 5 is the default and built into Processing v.3
//frameRate(60);//(default is 60)
beginRecord(PDF,"ProceduralArtwork.pdf");//opens a new file and begins recording the functions that follow to that file
3. image(TriBG,0,BGy);//draws the BG image as soon as the program is run (movement then occurs over the top)
}
//function for the main tree - setting up recursion
void treeBranch(float h)
{
stroke(lerpColor(c1[0],c1[1],ctransition));//colour of the lines is lerped between purple and green
strokeWeight(2);//weight or thickness of the lines
h *= 0.6;//each branch will be 2/3rds the size of the previous one
//as this is a recursive function, there must be a condition of exit otherwise the function would continue working and the program would crash
if (h > 2)//if the length of the branch is 2 pixels or less...
{
//branching off to the right
pushMatrix();//saves the position
rotate(radians(45));
line(0, 0, 0, -h);//draws the branch
translate(0, -h);//moves the coordinate system to the end of the previously drawn branch
treeBranch(h);//draws two new branches
popMatrix();//restores to previous matrix state
//same as above although branching off to the left
pushMatrix();//saves the position
rotate(radians(-45));
line(0, 0, 0, -h);
translate(0, -h);
treeBranch(h);//draws two new branches
popMatrix();//restores to previous matrix state
}
}
//function for the main tree - referenced in void draw
void drawBranches1(int xdB, int ydB)//based off Daniel Shiffman's "Recursive Tree"
{
4. pushMatrix();//saves the current coordinate system
translate(xdB,ydB);//moves the coordinate system to (xdB, ydB)
treeBranch(500);//starts the recursive branching
popMatrix();//restores the prior coordinate system
}
//function for the yellow scaled 90 degree variant
void ninetyDegree(float h)//based off Daniel Shiffman's "Recursive Tree"
{
stroke(lerpColor(c1[0],c1[2],ctransition1));//colour of the lines is lerped between purple and yellow
strokeWeight(2);//weight or thickness of the lines
h *= 0.6;//each branch will be 2/3rds the size of the previous one
//as this is a recursive function, there must be a condition of exit otherwise the function would continue working and the program would crash
if (h > 2)//if the length of the branch is 2 pixels or less...
{
//branching off to the right
pushMatrix();//saves the position
rotate(radians(90));
line(0, 0, 0, -h);//draws the branch
translate(0, -h);//moves the coordinate system to the end of the previously drawn branch
ninetyDegree(h);//draws two new branches
popMatrix();//restores to previous matrix state
//same as above although branching off to the left
pushMatrix();//saves the position
rotate(radians(-90));
line(0, 0, 0, -h);
translate(0, -h);
ninetyDegree(h);//draws two new branches
popMatrix();//restores to previous matrix state
}
}
//function for the yellow scaled 90 degree variant
5. void ninetyDegreeTree(int xdB2, int ydB2)//based off Daniel Shiffman's "Recursive Tree"
{
pushMatrix();
translate(xdB2,ydB2);
rotate(radians(45));
ninetyDegree(500);//starts the recursive branching
popMatrix();
}
void draw()//continuously loops
{
int m = millis();
println("millis = " + m);
println("frame count = " + frameCount);
if(BGy == 0 || BGy <= height)
{
BGy = BGy + speed;//adds speed to the variable to create movement on the y-axis
tint(255,127);//sets the image's alpha to be 50% transparent
image(TriBG,0,BGy);//triangles move down the y-axis to form stripey background
}
//if(frameCount >= 16 && frameCount <= 36)
if(BGy >= height)//when TriBG reaches the bottom of the canvas...
{
tint(255);//resets the alpha / opacity level back to the default of 100% (not transparent)
image(StripeyBG,0,0);//draws the stripey background image
pushMatrix();
drawBranches1(960,740);//utilises the tree function and draws one above the face
popMatrix();
image(Face,440,410);//displays face illustration at the bottom middle point of the canvas
}
if(frameCount >= 35 && frameCount <= 75)
6. {
image(StripeyBG,0,0);//draws the stripey background image
image(Face,440,410);//displays face illustration at the bottom middle point of the canvas
pushMatrix();
drawBranches1(960,740);//utilises the tree function and draws one above the face
ctransition+=0.2*transDir;//increases in 0.05 increments in the specified direction with each draw call
if(ctransition > 1) transDir = -1;//loops the lerping transition between purple and green
if(ctransition < 0) transDir = 1;//(transitions forward until it reaches the end and then goes backwards)
popMatrix();
image(Face,440,410);//displays face illustration on top of the tree pushMatrix();
}
//dense concave curves out from centered point
if(frameCount >= 58)//roughly 10300 millis
{
pushMatrix();
translate(960,400);
for(float t = 0; t < 100; t+= 0.05)
{
float sX = r1/cos(t);
float sY = r1/sin(t);
r1 += 0.02;//radius
int c = c1[(int)random(0,3)];//random colour from array
fill(c);
noStroke();
if(random(100) < 50)
ellipse(sX,sY,5,5);
else
ellipse(sX,sY,15,15);
}
popMatrix();
}
7. //circle from center (based on textspiral.pde)
if(frameCount >= 63)//12100 millis
{
pushMatrix();
translate(960,400);
for(float t = 0; t < 2*PI; t+= 0.05)
{
float sX = r1*cos(t);
float sY = r1*sin(t);
r1 += 0.02;//radius
fill(lerpColor(c1[0],c1[1],ctransition1));//colour of the lines is lerped between purple and green
ctransition1+=0.1*transDir1;//increases in 0.05 increments in the specified direction with each draw call
if(ctransition1 > 1) transDir1 = -1;//loops the lerping transition between purple and green
if(ctransition1 < 0) transDir1 = 1;//(transitions forward until it reaches the end and then goes backwards)
noStroke();
if(random(100) < 50)//if random number is less than 100...
ellipse(sX,sY,5,5);
else
ellipse(sX,sY,15,15);
}
popMatrix();
}
//second circle from center (based on textspiral.pde)
if(frameCount >= 66 && frameCount <= 78)
{
pushMatrix();
translate(960,400);
for(float t = 0; t < 50; t+= 0.05)
{
float sX1 = r2*cos(t);
float sY1 = r2*sin(t);
r2 += 0.02;
8. fill(lerpColor(c1[0],c1[1],ctransition1));//colour of the lines is lerped between purple and green
noStroke();
if(random(100) < 50)
ellipse(sX1,sY1,5,5);
else
ellipse(sX1,sY1,15,15);
}
popMatrix();
}
if(frameCount >= 78)
{
if(thirdEyeSize < 360)
{
thirdEyeSize += 10;
}
imageMode(CENTER);
image(ThirdEye, 960, 395, thirdEyeSize, thirdEyeSize);
imageMode(CORNER);
pushMatrix();
translate(960,400);
for(float t = 0; t < 2*PI; t+= 0.1)
{
float sX = r2/cos(t);
float sY = r2/sin(t);
r2 += 0.05;
int c = c1[(int)random(0,3)];
fill(c);
//noStroke();
if(random(100) < 50)
9. ellipse(sX,sY,5,5);
else
ellipse(sX,sY,15,15);
}
popMatrix();
}
if(frameCount >= 100)
{
rectangleHeight += 15;//rectangle gets 10 pixels longer with each draw call
fill(c1[1]);//green
rectMode(CENTER);//shape is placed with the specified coordinates at its center
rect(436,0,22,rectangleHeight);//left side
rect(1484,0,22,rectangleHeight);//right side
rectangleHeight1 += 20;//rectangle gets 15 pixels longer with each draw call
fill(c1[3]);//cream
noStroke();//no outline
rect(400,0,10,rectangleHeight1);
rect(1520,0,10,rectangleHeight1);
}
if(frameCount >= 116 && frameCount <= 150)
{
iR+=5;//add to the variable with each draw call, which increases the rotation
//rotating tree left
pushMatrix();
translate(350,350);
rotate(radians(iR));
scale(0.3);
ninetyDegreeTree(0,0);
popMatrix();
//rotating tree right
10. pushMatrix();
translate(1570,350);
rotate(radians(iR));
scale(0.3);
ninetyDegreeTree(0,0);
popMatrix();
}
if(frameCount >= 121 && frameCount <= 150)
{
//yellow expanding circle made from rectangles of varying lengths - left side
pushMatrix();
translate(350,350);
for(float t = 0; t < 2*PI; t+= 0.2)//t = speed
{
float sX = r3*cos(t);
float sY = r3*sin(t);
r3 += 0.05;
fill(c1[2]);
noStroke();
if(random(100) < 70)
rect(sX,sY,-60,-2.5);
if(random(100) < 35)
rect(sX,sY,-40,-2.5);
else
rect(sX,sY,-20,-2.5);
}
popMatrix();
//yellow expanding circle made from rectangles of varying lengths - right side
pushMatrix();
translate(1570,350);
for(float t = 0; t < 2*PI; t+= 0.2)//t = speed
11. {
float sX = r3*cos(t);
float sY = r3*sin(t);
r3 += 0.05;
fill(c1[2]);
noStroke();
if(random(100) < 70)
rect(sX,sY,-60,-2.5);
if(random(100) < 35)
rect(sX,sY,-40,-2.5);
else
rect(sX,sY,-20,-2.5);
}
popMatrix();
}
if(frameCount >= 140)
{
// draw the waveforms
// the values returned by left.get() and right.get() will be between -1 and 1,
// so we need to scale them up to see the waveform
//as the file is MONO, left.get() and right.get() return the same value, so left.get() has been used to simplify
for(int iA = 0; iA < BGBeats.bufferSize() - 1; iA++)
{
pushMatrix();
float yA1 = map(iA, 0, BGBeats.bufferSize(), 0, height);
float yA2 = map(iA+1, 0, BGBeats.bufferSize(), 0, height);
stroke(lerpColor(c1[0],c1[3],ctransition1));
strokeWeight(2);
line(87.5 + BGBeats.left.get(iA)*50, yA1, 87.5 + BGBeats.left.get(iA+1)*50, yA2);//far left
line(1832.5 + BGBeats.left.get(iA)*50, yA1, 1832.5 + BGBeats.left.get(iA+1)*50, yA2);//far right
popMatrix();
}
12. }
if(frameCount >= 150)
{
stroke(c1[2]);//yellow
strokeWeight(5);
line(370,0,370,1080);//left side
line(1550,0,1550,1080);//right side
}
if(frameCount >= 172 && frameCount <= 196)
{
float t2 = (frameCount % 100) * 0.01;//animated at 1% of the frame count
float xBL2 = bezierPoint(960,736,185,185,t2);//left curve - middle - x-coordinates
float yBL2 = bezierPoint(590,-153,195,1080,t2);//left curve - middle - y-coordinates
float xBL3 = bezierPoint(960,694,316,311,t2);//left curve - bottom - x-coordinates
float yBL3 = bezierPoint(590,13,349,1080,t2);//left curve - bottom - y-coordinates
float xBR2 = bezierPoint(960,1184,1736,1736,t2);//right curve - middle - x-coordinates
float yBR2 = bezierPoint(590,-153,195,1080,t2);//right curve - middle - y-coordinates
float xBR3 = bezierPoint(960,1227,1610,1610,t2);//right curve - bottom - x-coordinates
float yBR3 = bezierPoint(590,13,349,1080,t2);//right curve - bottom - y-coordinates
pushMatrix();
fill(c1[3]);//fills shapes and makes text a cream colour
textSize(noise(random(50))*50); //perlin noise text size (scaled by 50)
textAlign(CENTER);//text is drawn with the specified coordinates at its center
int index = int(random(words.length));//same as int(random(10))
text(words[index], xBL2, yBL2);//places random words from a predefined string at coordinates along the middle-left bezier
text(words[index], xBR2, yBR2);//places random words from a predefined string at coordinates along the middle-right bezier
fill(c1[2]);//fills shapes and makes text a yellow colour
ellipse(xBL3,yBL3,20,20);//places an ellipse that follows the coordinates of the bottom-left bezier
13. ellipse(xBR3,yBR3,20,20);//places an ellipse that follows the coordinates of the bottom-right bezier
popMatrix();
}
if(frameCount >= 183 && frameCount <= 196)
{
//pulsating
pushMatrix();
translate(960,395);
if (thirdEyeSize > 360) {
shrinkOrGrow = 0;
} else if (thirdEyeSize < 360) {
shrinkOrGrow = 1;
}
if (shrinkOrGrow == 1) {
thirdEyeSize += 1;
} else if (shrinkOrGrow == 0) {
thirdEyeSize -= 1;
}
tint(lerpColor(c1[0],c1[3],ctransition1), 157);
imageMode(CENTER);
image(ThirdEye, 0, 0, thirdEyeSize, thirdEyeSize);
imageMode(CORNER);
popMatrix();
for(int iA = 0; iA < BGBeats.bufferSize() - 1; iA++)
{
pushMatrix();
float yA1 = map(iA, 0, BGBeats.bufferSize(), 0, height);
float yA2 = map(iA+1, 0, BGBeats.bufferSize(), 0, height);
stroke(lerpColor(c1[0],c1[3],ctransition1));
strokeWeight(2);
line(262.5 + BGBeats.left.get(iA)*30, yA1, 262.5 + BGBeats.left.get(iA+1)*30, yA2);//inner left
line(1657.5 + BGBeats.left.get(iA)*30, yA1, 1657.5 + BGBeats.left.get(iA+1)*30, yA2);//inner right
popMatrix();
14. }
}
if(frameCount >= 200)
{
if(thirdEyeTSize < 450)//growth of image will continue until it is 450x450px
{
thirdEyeTSize += 40;//increases by 40px each draw loop
}
tint(255);//fully opaque
imageMode(CENTER);//draw based on the coordinates at the image's center
image(ThirdEyeTri, 950, 365, thirdEyeTSize, thirdEyeTSize);//solid image beneath to cover anything behind
tint(c1[0], 127);//purple tint at 50% opacity
image(ThirdEyeTri, 950, 365, thirdEyeTSize, thirdEyeTSize);//tinted semi-transparent image
imageMode(CORNER);//reverts image placement back to the default
}
//timer for testing purposes
/*pushMatrix();
textSize(24);
text("millis = " + m, 100,50);
text("frame count = " + frameCount, 100, 150);
popMatrix();*/
}
void keyPressed()//simple function based off week 9 practical practice question #10
{
if(key == 's')//if the "s" key is pressed...
{
endRecord();//the process of recording to a PDF will be completed and the file will be closed
}
}