Creating Directions for Origami using HTML5 JavaScript or Processing

Slides:



Advertisements
Similar presentations
CSCI 3100 Tutorial 6 Web Development Tools 1 Cuiyun GAO 1.
Advertisements

Origami Bookmark Your paper should look like a square.
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
CIT110 – Introduction to Information Technology Dr. Catherine Dwyer Fall 2011.
ITGS Internal Assessment The Project. What is the Project? An original IT solution to a real problem with a specified ‘client.’ A challenging task using.
Information Technology Center Hany Abdelwahab Computer Specialist.
Maximizing Teaching & Learning For the Short Course.
 As you complete the assignment, go in order as the earlier bulleted parts provide an easier opportunity for points than the later.  This project is.
Director of Computer Center, DaYeh University Ku-Yaw Chang.
Introduction to course. Refresher on client/server; JavaScript.
Javascript: More features B. Ramamurthy 7/4/2014B. Ramamurthy, CSE651C1.
Jump to first page 10/2/2015 Learning PowerPoint A Tutorial Start.
Programming Games Show your simple video. More video examples. Audio. Classwork/Homework: Produce more complex video program.
Project – Show me what you know! EXPLORING COMPUTER SCIENCE – LESSON 3-9.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 3.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Lecture Comp 25 Math & Logic Discussion. What is logic? Logic is the study of reason Focus is the method or process by which an argument unfolds Aristotle.
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
EXAMPLES OF DIGITAL ARCHIVES AND LIBRARIES Advanced Techniques in Processing Images Advanced Techniques in Processing Images Chapter 6. Slide 57.
Programming games Review concepts. Crooked coin toss. Drawing on canvas. Homework: Complete [static] drawings. Upload files to website.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
Invitation to Computer Science 6 th Edition Chapter 10 The Tower of Babel.
CSCI 3100 Tutorial 2 Web Development Tools 1 HTML 5 & CSS 3 1.
Physics 114: Lecture 1 Overview of Class Intro to MATLAB
Using FlexTraining.
Discussion Lecture Comp 25 Math & Logic.
Geometry Origami - Angelfish
Creating a Flash Web Site
Top 8 Best Programming Languages To Learn
Learning PowerPoint A Tutorial.
Images, Hyperlinks, and Sound
CSE 102/ISE 102 Introduction to Web Design and Programming
What is HTML? Acronym for: HyperText Markup Language
Creating Websites With WordPress
Classwork: Examine and enhance falling drop(s) or make your own.
Pre-Coding Web Design – Sec 3-1
Microsoft® Office FrontPage® 2003 Training
Statement atoms The 'atomic' components of a statement are: delimiters (indents, semicolons, etc.); keywords (built into the language); identifiers (names.
Creating a Baseline Grid
Introduction CSE 1310 – Introduction to Computers and Programming
Chapter 2 Visual Basic Interface
Programming Games Computer science big ideas and Computer Science jargon: review of things we have used in examples. Show virtual dog Homework: [Catch.
Beginner programming Lesson
Essentials of Web Pages
The Canvas.
Chapter 27 WWW and HTTP.
Microsoft Word - Formatting Pages
Information Technologies Anselm Spoerri PhD (MIT)
Tutorial 6 Creating Dynamic Pages
Microsoft Word - Formatting Pages
An origami-inspired adventure in number theory…and on limits
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
Fast, free, fun Weebly web sites.
Starting to develop a website
Introduction to Primitive Data types
Images, Hyperlinks, and Sound
Static and Dynamic Web Pages
Bryan Burlingame 13 February 2019
Lesson 7: Video, Audio and Image Techniques
Teaching slides Chapter 6.
Power Point 101.
Programming games Share your plans for your virtual something.
Catchup. Work on project.
The <script> Tag
Go over midterm. CSS catchup. Work session Homework: complete project
An Origami-inspired adventure in Mathematics
Introduction to Primitive Data types
Programming games Reprise on dice game and alternative dice game
An Origami-inspired adventure in Mathematics
Presentation transcript:

Creating Directions for Origami using HTML5 JavaScript or Processing Jeanine Meyer Purchase College/SUNY http://faculty.purchase.edu/jeanine.meyer

Overview Solution in search of a problem Demonstration, show code JavaScript overview Processing overview Lessons for my classes

My challenge HTML5 (with JavaScript) added functionality Drawing on canvas Incorporating video (without use of plug-ins) Already had use of images I wanted a task that would use features (including images) together. First used in Programming Games course, using HTML, JavaScript and CSS.

Later… Realized that though I was driven by solution in search of a problem… This was a way to encourage students to think in opposite way: What technique was most appropriate for specific problem.

Origami Standard format for directions using line drawing. Sometimes all photographs used. Video clips becoming common My approach is to use most appropriate for each step. My objective as a programming teaching is to get students to think about what is the best for their applications at the appropriate level of granularity. Demonstrate the power of mathematics (algebra, trigonometry, geometry).

Demonstration Page with other JavaScript examples: http://faculty.purchase.edu/jeanine.meyer/morehtml5examples.html

Structure Array named steps holding functions and text Basic functions such as valley, mountain, proportion, skinnyline, curvedarrow (most complex), etc. Note: I should make this a distinct file to be brought in as external JavaScript Specific to model, for example playtalk for playing video, lips, etc. Standard trick of including video elements to make sure videos are loaded, but using CSS in style element to make them not be displayed immediately. Look at source code online.

var steps= [ [directions,"Diagram conventions var steps= [ [directions,"Diagram conventions. Kissy fish by Junior Fritz Jacquet from Piranha by Jun Maekawa."], [showkami,"Make quarter turn."], [diamond1,"Fold top point to bottom point."], [triangleM,"Divide line into thirds and make valley folds and unfold "], … ];

function valley(x1,y1,x2,y2,color) { var px=x2-x1; var py = y2-y1; var len = dist(x1,y1,x2,y2); var nd = Math.floor(len/(dashlen+dgap)); var xs = px/nd; var ys = py/nd; if (color) ctx.strokeStyle = color; ctx.beginPath(); for (var n=0;n<nd;n++) { ctx.moveTo(x1+n*xs,y1+n*ys); ctx.lineTo(x1+n*xs+dratio*xs,y1+n*ys+dratio*ys); } ctx.closePath(); ctx.stroke(); ctx.strokeStyle = origstyle;

Processing Processing is built on / with Java for digital artists. Has its own Processing Development Environment. We use it for Computer Science I. Strongly recommend! Java in CS2 Java or Python in Data Structures Python in Number Theory JavaScript (and php) in Scripting course php and SQL in Database course Advanced Topics course can use R, Haskell, Max, ? Processing has Line drawing on canvas Videos require a library and this can be problematic. Images and videos can be independent of canvas Programs very similar but Processing required using parallel structures: an array steplabels for the labels and a switch statement for the function calls for the steps Programs available on request and/or buy my books!

void donext() { if (nextstep>=steplabels void donext() { if (nextstep>=steplabels.length) { nextstep=steplabels.length-1; } //this may be overkill. Stopping videos each time. talkPlaying = false; sinkPlaying = false; talkVideo.stop(); sinkVideo.stop(); background(255); switch (nextstep){ //this corresponds to the order of labels in the steplabels array case 0: directions(); break; case 1: showkami(); case 2: diamond1(); …

String[] steplabels= { //must correspond with the switch statement String[] steplabels= { //must correspond with the switch statement. "Diagram conventions. Kissy fish by Junior Fritz Jacquet from Piranha by Jun Maekawa.", "Make quarter turn.", "Fold top point to bottom point.", "Divide line into thirds and make valley folds and unfold ", "Fold in half to the left.", "Fold down the right corner to the fold marking a third. ", … ];

void valley(float x1,float y1,float x2,float y2) { float px=x2-x1; float py = y2-y1; float len = dist(x1,y1,x2,y2); float nd = int(len/(dashlen+dgap)); float xs = px/nd; float ys = py/nd; for (int n=0;n<nd;n++) { line(x1+n*xs, y1+n*ys,x1+n*xs+dratio*xs,y1+n*ys+dratio*ys); }

References http://faculty.purchase.edu/jeanine.meyer/origamiDirections.pdf My books frequently contain origami-related material Programming 101 (Processing), Apress, June, 2018 Origami flower HTML5 and JavaScript Projects, Apress, 2nd Edition on schedule for publication very soon. Chapter on using HTML & JavaScript for Origami Directions