The document describes an object-oriented particle system simulation. It defines a Particle class with properties like position, velocity, and force. A testApp class contains a vector of Particle objects and methods for initializing, updating, and drawing the particles. The update method applies forces and damping, while the draw method plots the particles and displays debugging text. Mouse and key inputs are used to manipulate the particles by adding or clearing them. Image textures are later added to the particles for visual effects.
This document discusses WebRTC Native Client (WebRTC NaCl), which allows using the WebRTC API from native applications. It describes how WebRTC NaCl can be used to build native clients for WebRTC using C++ on Windows, macOS, Linux, iOS, and Android. It also summarizes the WebRTC Native Client project Momo, which provides a C++ library for building WebRTC applications that can run on devices like Raspberry Pi.
PyCon JP 2021 (2021/10/16) @Hirosaji @Hirosaji_draw
https://2021.pycon.jp/time-table/?id=273843
※表示画面が小さいと感じる場合は、次のSpeakerDeckをご覧ください。
https://speakerdeck.com/hirosaji/the-art-of-reading-illustrations
=====
Title (English): The Art of Reading Pictures: Illustration Analysis in Python
This document discusses Python data types and handling data in Python. It covers the different types of numbers in Python including integers, floating point numbers, and complex numbers. It also discusses Boolean, string, and tuple data types. Methods for accessing and slicing strings are provided along with examples. Mutable and immutable objects are defined, with lists and tuples given as examples. Operator precedence in Python is also discussed.
Spresense Study meeting#1 How to use the Camera board義則 太田
?
This material is made for Spresense Study meeting #1 that was
held in Sony Creative Lounge on 18th April. Unfortunately this material is written in Japanese. If you want to have English one, please let me know.
This document outlines a Python-Django training course held at HCMUT in summer 2012. It provides details on the instructors, tools used in the training including Notepad++ and command line, and covers 13 parts that make up the content of the course including introductions to Python, Django, HTML/CSS, installation, models, views, templates and deployment. Exercises are provided to help reinforce learning concepts in Python and using HTML, CSS, and JavaScript to create a form.
This document discusses WebRTC Native Client (WebRTC NaCl), which allows using the WebRTC API from native applications. It describes how WebRTC NaCl can be used to build native clients for WebRTC using C++ on Windows, macOS, Linux, iOS, and Android. It also summarizes the WebRTC Native Client project Momo, which provides a C++ library for building WebRTC applications that can run on devices like Raspberry Pi.
PyCon JP 2021 (2021/10/16) @Hirosaji @Hirosaji_draw
https://2021.pycon.jp/time-table/?id=273843
※表示画面が小さいと感じる場合は、次のSpeakerDeckをご覧ください。
https://speakerdeck.com/hirosaji/the-art-of-reading-illustrations
=====
Title (English): The Art of Reading Pictures: Illustration Analysis in Python
This document discusses Python data types and handling data in Python. It covers the different types of numbers in Python including integers, floating point numbers, and complex numbers. It also discusses Boolean, string, and tuple data types. Methods for accessing and slicing strings are provided along with examples. Mutable and immutable objects are defined, with lists and tuples given as examples. Operator precedence in Python is also discussed.
Spresense Study meeting#1 How to use the Camera board義則 太田
?
This material is made for Spresense Study meeting #1 that was
held in Sony Creative Lounge on 18th April. Unfortunately this material is written in Japanese. If you want to have English one, please let me know.
This document outlines a Python-Django training course held at HCMUT in summer 2012. It provides details on the instructors, tools used in the training including Notepad++ and command line, and covers 13 parts that make up the content of the course including introductions to Python, Django, HTML/CSS, installation, models, views, templates and deployment. Exercises are provided to help reinforce learning concepts in Python and using HTML, CSS, and JavaScript to create a form.
The document describes code for displaying and formatting text in Processing. It includes code to set up a sketch, draw text centered horizontally and vertically on a white background, draw lines to intersect at the center, and draw the same text aligned to the right, center, and with different textAlign settings.
The document discusses sinusoidal waves and polar coordinates. It contains code examples that generate sinusoidal waves by plotting ellipses along the y-axis using sinusoidal functions of the theta variable. The theta variable is incremented each frame to animate the waves. It also contains an explanation of polar coordinates using the notation (r*cos(θ),r*sin(θ)) to represent a point in polar space. Finally, it shows code for circular motion by calculating x and y coordinates based on polar coordinates and animating theta to rotate around a circle.
34. 円をたくさん描く
void draw() {
background(255, 255, 255);
int x = 20;
int y = 200;
int d = 30;
for (int i = 0; i < 8; i++) {
ellipse(x + i * 40, y, d, d);
}
}
初期値
継続条件
{ }の中身の後に
毎回やる事
35. 円をたくさん描く
void draw() {
background(255, 255, 255);
int x = 20;
int y = 200;
int d = 30;
for (int i = 0; i < 8; i++) {
ellipse(x + i * 40, y, d, d);
}
}
初期値
継続条件
{ }の中身の後に
毎回やる事
x = 20, 60, 100, 140, 180,
220, 260, 300
i = 0, 1, 2, … , 6, 7
46. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 30;
int num = 8;
for (int i = 0; i < num; i++) {
int R = 150;
float x = R * cos(i * TWO_PI / num);
float y = R * sin(i * TWO_PI / num);
ellipse(x, y, d, d);
}
popMatrix();
}
47. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 30;
int num = 8;
for (int i = 0; i < num; i++) {
int R = 150;
float x = R * cos(i * TWO_PI / num);
float y = R * sin(i * TWO_PI / num);
ellipse(x, y, d, d);
}
popMatrix();
}
pushMatrix?popMatrixの間は
(0, 0)の位置を左上から
キャンバスの中心に移動
(translate)
width : キャンバスの横の長さ
height : キャンバスの縦の長さ
48. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 30;
int num = 8;
for (int i = 0; i < num; i++) {
int R = 150;
float x = R * cos(i * TWO_PI / num);
float y = R * sin(i * TWO_PI / num);
ellipse(x, y, d, d);
}
popMatrix();
}
intが整数型だったのに対し、
floatは浮動小数点数型
TWO_PI = 2π
49. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 30;
int num = 8;
for (int i = 0; i < num; i++) {
int R = 150;
float x = R * cos(radians(i * 360 / num));
float y = R * sin(radians(i * 360 / num));
ellipse(x, y, d, d);
}
popMatrix();
}
50. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 30;
int num = 8;
for (int i = 0; i < num; i++) {
int R = 150;
float x = R * cos(radians(i * 360 / num));
float y = R * sin(radians(i * 360 / num));
ellipse(x, y, d, d);
}
popMatrix();
}
radians関数が角度を
ラジアン(弧度法)に
変換してくれる
360度→2π
62. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 10;
int num = 360;
int t = 4;
for (int i = 0; i < num; i++) {
float R = 150 * abs(sin(radians(i * t)));
float x = R * cos(radians(i * 360 / num));
float y = R * sin(radians(i * 360 / num));
ellipse(x, y, d, d);
}
popMatrix();
}
63. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 10;
int num = 360;
int t = 4;
for (int i = 0; i < num; i++) {
float R = 150 * abs(sin(radians(i * t)));
float x = R * cos(radians(i * 360 / num));
float y = R * sin(radians(i * 360 / num));
ellipse(x, y, d, d);
}
popMatrix();
}
R を0から150の間で
いったりきたり増減させている
abs関数を通すと絶対値の値が
出力されるので
マイナス部分がプラスとして
得られる
絶対値 : 0からの距離
(例 : -3と3は0から3の距離)
64. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 10;
int num = 360;
int t = 4;
for (int i = 0; i < num; i++) {
float R = 150 * abs(sin(radians(i * t)));
float x = R * cos(radians(i * 360 / num));
float y = R * sin(radians(i * 360 / num));
ellipse(x, y, d, d);
}
popMatrix();
}
1から順に数字に変えてみましょう!
66. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 10;
int num = 360;
int t = 4;
for (int i = 0; i < num; i++) {
noStroke();
if (i % 3 == 0) {
fill(0, 0, 200);
d = 10;
} else {
fill(0, 150, 200);
d = 5;
}
float R = 150 * abs(sin(radians(i * t)));
float x = R * cos(radians(i * 360 / num));
float y = R * sin(radians(i * 360 / num));
ellipse(x, y, d, d);
}
popMatrix();
}
67. Processingで円を円状に配置する
void draw() {
background(255, 255, 255);
pushMatrix();
translate(width/2, height/2);
int d = 10;
int num = 360;
int t = 4;
for (int i = 0; i < num; i++) {
noStroke();
if (i % 3 == 0) {
fill(0, 0, 200);
d = 10;
} else {
fill(0, 150, 200);
d = 5;
}
float R = 150 * abs(sin(radians(i * t)));
float x = R * cos(radians(i * 360 / num));
float y = R * sin(radians(i * 360 / num));
ellipse(x, y, d, d);
}
popMatrix();
}
もしも3で割った余りが0なら
→ 3で割り切れる数字ならば
そうでない時は...