Graphics Animation Using Borland’s bgi

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1 Emmanuel Agu.
Graphics Animation Using Borland’s bgi Mr. Dave Clausen La Cañada High School.
1 Computer Graphics Week6 –Basic Transformations- Translation & Scaling.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
CS 106 Introduction to Computer Science I 02 / 12 / 2007 Instructor: Michael Eckmann.
Functions and Equations of Two Variables Lesson 6.1.
Introduction In an equation with one variable, x, the solution will be the value that makes the equation true. For example: 1 is the solution for the equation.
Programing App Inventor. Variable Declaration App Inventor: Declare Variables using the “Define Variable As” Block – Find the Blocks Editor (top-left),
1.4 Parametric Equations. There are times when we need to describe motion (or a curve) that is not a function. We can do this by writing equations for.
CPS120 Introduction to Computer Science Iteration (Looping)
Chapter 3 Kinematics in Two Dimensions; Vectors. Units of Chapter 3 Projectile Motion Solving Problems Involving Projectile Motion Projectile Motion Is.
Mr. Dave Clausen1 La Cañada High School Chapter 6: Repetition Statements.
New Tools And Workshop Mod & For Loops. Modulo Calculates the remainder (remember long division?) % Examples: 7 % 3 10 % 2 2 % 3 evaluates to 1 evaluates.
Getting Started with TI-Interactive. TI-Interactive TI-Interactive can be used to create a variety of graphs. Scatter Plots, Line Plots, Histograms, Modified.
Structured Program Development Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010.
Reference: The Game Loop Animation / Game loop 1. Update variables 2. [Get input from the user] (GameLoop only) 3. Draw (using variables)
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 6B Methods (Tutorial)
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Applications of Loops: The power of MATLAB Mathematics + Coding
Lecture 3 Transformations. 2D Object Transformations The functions used for modifying the size, location, and orientation of objects or of the camera.
CPS120 Introduction to Computer Science Iteration (Looping)
Repetition Statements (Loops). 2 Introduction to Loops We all know that much of the work a computer does is repeated many times. When a program repeats.
9. ITERATIONS AND LOOP STRUCTURES Rocky K. C. Chang October 18, 2015 (Adapted from John Zelle’s slides)
The Selection Sort Mr. Dave Clausen La Cañada High School.
Visual C++ Programming: Concepts and Projects Chapter 10A: Recursion (Concepts)
Computer Programming 12 Lesson 6 – Loop structure By: Dan Lunney.
Chapter 2 Motion in One Dimension. Quantities in Motion Any motion involves three concepts Displacement Velocity Acceleration These concepts can be used.
CS 106 Introduction to Computer Science I 02 / 15 / 2008 Instructor: Michael Eckmann.
CMPSC 200 Fall 2013 Lecture 37 November 18, 2013.
Unit 6 – Multimedia Element: Animation
The Bubble Sort Mr. Dave Clausen La Cañada High School
Motion in One Dimension
Create a Halloween Computer Game in Scratch
PARABOLAS Topic 7.2.
Ultimate Strength Analysis of Arbitrary Cross Sections under Biaxial Bending and Axial Load by Fiber Model and Curvilinear Polygons Aristotelis Charalampakis.
Character Animation Forward and Inverse Kinematics
Unit 3 Lesson 9 Repetition Statements (Loops)
Algebra
Computer Application in Engineering Design
CHAPTER 6: REPETITION AND LOOP STATEMENTS
The Sequential Search (Linear Search)
Scratch: iteration / repetition / loops
Java Programming: Guided Learning with Early Objects
Ch 7: JavaScript Control Statements I.
Repetition Structures (Loops)
JavaScript: Control Statements.
Mr. Dave Clausen La Cañada High School
WARMUP 1. y > – x – 4 y < 2x + 2.
PARABOLAS Topic 7.2.
Devil Physics Baddest Class on Campus AP Physics
Game Loop Update & Draw.
Mr. Dave Clausen La Cañada High School
Chapter 6: Repetition Statements
Graphics Animation Using Terrapin LOGO
Data Structures Sorted Arrays
Relaxation Technique CFD
Functions Rules and Tables.
FLUENCY WITH INFORMATION TECNOLOGY
More Loops Topics Counter-Controlled (Definite) Repetition
Loops.
CS100J Lecture 16 Previous Lecture This Lecture Programming concepts
More Loops Topics Counter-Controlled (Definite) Repetition
CS100J Lecture 16 Previous Lecture This Lecture Programming concepts
The Iterative Design Recipe
Creating a Simple Game in Scratch
JavaScript 101 Lesson 8: Loops.
Programming II Vocabulary Review Loops & functions
More Loops Topics Counter-Controlled (Definite) Repetition
Linear Equations & Graphing
Presentation transcript:

Graphics Animation Using Borland’s bgi Mr. Dave Clausen La Cañada High School

Graphics Commands for the bgi Graphics Animation 11/15/2018 Graphics Commands for the bgi Remember, a summary of Borland’s graphics commands for Borland C++ 3.0 for DOS and Borland C++ for Windows can be found in a previous lecture. 11/15/2018 Mr. Dave Clausen Mr. Dave Clausen

Animation basic concepts. The basic concept for graphics animation is to have some form of loop (definite or indefinite), where we draw an image, erase it (by drawing it exactly again, only in the background color instead of the foreground color), and update its coordinates. This process repeats until the image reaches a desired location, or until some other condition is met. 11/15/2018 Mr. Dave Clausen

Blinking Objects The algorithm for a blinking object is as follows: Draw the object (in a foreground color) For a definite number of iterations do (or while) Erase the object (draw in the background color) Pause for a specified time (as necessary) blink.cpp blink.txt blink.exe 11/15/2018 Mr. Dave Clausen

Linear motion The algorithm for linear motion is: Draw the image in the foreground color(s) While the image is not at its destination (or for) Pause for a specified time (use symbolic constants) Erase the image (draw it in the background color) Update the image’s position To update the image’s position, increment or decrement: y = y + delta_y; or y = y - delta_y; x = x + delta_x; or x = x - delta_x; 11/15/2018 Mr. Dave Clausen

Linear motion: y in terms of x The algorithm remains the same as defined on previous slides. The difference is how we calculate the variable delta_y in terms of x. For linear paths we may use the increment: y = y + (3* x - 5); //The equation of a line between 2 points is: Mvsquare.cpp Mvsquare.txt Mvsquare.exe 11/15/2018 Mr. Dave Clausen

Non linear motion The algorithm remains the same as defined on previous slides. The difference is how we calculate the variable delta_y in terms of x. For parabolic paths we may use the function: y = y + (0.01 * (x * x)); //The basic formula for a parabola in standard form: parabola.cpp parabola.txt parabola.exe 11/15/2018 Mr. Dave Clausen

To Move an Object in a Parabolic Path: Let’s look at this example which doesn’t merely draw a parabola, but moves an object in a parabolic path. paracirc.cpp paracirc.txt paracirc.exe 11/15/2018 Mr. Dave Clausen

Other Examples: Let’s look at examples of previous student’s work. They fall into 2 categories: non-interactive animation as previously discussed interactive animation using indefinite loops while not kbhit( ). Keys can be detected using getch( ) Using switch or nested ifs to determine action of key hit. (use ASCII codes of the keys.) 11/15/2018 Mr. Dave Clausen