Letterkenny Institute of Technology
|
|
- Evelyn Miller
- 6 years ago
- Views:
Transcription
1 Letterkenny Institute of Technology BSc in Computing(Games) Subject: Games Programming 1 Stage: 1 Date: Autumn 2007 Examiners: J.G. Campbell Dr. M.D.J. McNeill Time Allowed: Two hours. INSTRUCTIONS Answer four questions from six. Failure to show derivation of answers and/or calculations may resultinlossofmarks. 1
2 1. Vector arithmetic. e 1 e 2 a b c [ 1 0 [ 0 1 [ 5 0 [ 0 4 [ 1 2 (1) (2) (3) (4) (5) d [ 2 1 (6) f g [ 4 3 [ 4 3 (7) (8) (a) (i)computea+b. [2 marks (ii)verifyyouranswerto(i)usingeithertheheadtotailruleortheparallelogramrule. You must provide a diagram. (iii)computef+g (iv) Compute 4f [2 marks [2 marks [2 marks 2
3 (b)thescalarordotproductoftwovectorscanbeexpressedintwoways: u v u v cosθ, (9) whereθistheanglebetweenthem,orintermsthesumofproductsofcomponents, u v(u x v x + ). (10) Whenu x,,v x, denotecomponentswithrespecttoanorthonormalbasis,bothequations give the same result. (i)computef c. (ii)computef e 1. (iii)computea b. (iv)computed f. [2 marks [2 marks [2 marks [2 marks (v)ifu v0andneitherofthemagnitudesofuorvarezero,whatcanyousayabout theanglebetweenuandv? (c) (i)computethemagnitudeofa, a. (ii)computethemagnitudeoff, f. [2 marks [2 marks [2 marks (d)computetheunitvectorˆfwhichisinthesamedirectionasfbuthasunitmagnitude. [3 marks 3
4 2. (a)figure1showsasmallmonochromeimageonasuperimposed10 10grid.Thegreylevelsofthe2 2rectanglesareasfollows:shadedcorrespondstomid-grey,blackto black,andwhitetowhite.thepixeldataarestoredineightbits,i.e.[ Showhowthefirstfourrowsoftheimagewouldbestoredinmemory(writedownthe numbers). Assume that the grid lines are invisible. [5 marks row 0 row 1 row 2 columns Figure 1: Monochrome image of a plane figure. (b)assumenowthatfigure1iscolourandthatshadedcorrespondstoblue,blacktogreen, and white to white. Showhowtheimagewouldbestoredinacomputer. Assumeasbeforethatthegrid linesareinvisibleandthateachcolouruseseightbits,i.e.[ youranswerwill contain lists of numbers, please ensure that you clearly indicate what each number refers to, i.e. row, column, colour. [5 marks (c)therearetwocarssidebysideinacarpark;oneiswhite,oneisred. Whydothey appearastheydo,i.e.thefirstoneappearwhite,andthesecondonered? [4 marks (d)figure2showsanimageofacharacterfroma2dplatformgame.theimagecontains a transparent rather than an opaque background. Explain the need for the transparent background. [4 marks Figure 2: Hero. 4
5 (e)youcanprobablyspotaliasinginfigure2.figure3showsanimageofatriangledrawn on a grid; the triangle is completely black and the background completely white. The imageistobesampledintopixelsateachgridsquare,anddigitisedto8bits[0(black)...255(white). (i) Draw a diagram to show what the digital image will look like, without anti-aliasing. [3 marks (ii)whatvalueswillpixelsa, b, c, dtakeonwithanti-aliasing? Note:digitisedto 8bits,[0(black)...255(white). [4 marks b a c d Figure 3: Anti-aliasing. 5
6 3.Figure4showsJavacodethatdrawssomeshapesandFigure5showstheresultantgraphics. There are two rectangle outlines(one black, one blue), one filled rectangle(blue), one circle (blue), one filled ellipse(red), one ellipse outline(black), and one line(blue). Please note that Rectangle2D.Double operates similarly to Ellipse2D.Double. Please note also that theoriginisatthetoplefthandcornerandthatthex-axispointstotheright(asnormal), but the y-axis points down. (a)basedonthecodeat// A,writeafragmentofcodetodrawarectangleofwidth80 andheight50withitstop-lefthandcornerat(x120,y140). (b)repeat(a)sothattherectangleiscolourgreenandfilled. [4 marks [4 marks (c)writecodetodrawtherectangleat// Ausinglines.Thecodeat// Bshowshowto createanddrawaline. (d)writecodetorotaterectanglerby45 anddrawit. [6 marks [2 marks (e)writecodewhichwilldrawadisk(filledcircle)at(150,50)(topleftofboundingbox) with diameter 80 and filled black. [4 marks (f)writecodewhichwilldrawacirclewithcentreat(180,80)andwithradius20. Be careful,notetheemphasison withcentreat and radius.drawadiagramtoshow how you arrived at the code and parameters. [5 marks 6
7 public class RectangleComponent11 extends JComponent public void paintcomponent(graphics g) Graphics2D g2 (Graphics2D) g; // A double x1 20; double y1 30; double xlen1 30; double ylen1 50; // Construct a rectangle and draw it Rectangle2D.Double r1 new Rectangle2D.Double(x1, y1, xlen1, ylen1); g2.draw(r1); double x2 20; double y2 30; double xlen2 30; double ylen2 50; Rectangle2D.Double r2 new Rectangle2D.Double(x2, y2, xlen2, ylen2); g2.draw(r2); Ellipse2D.Double e1 new Ellipse2D.Double(50, 250, 20, 40); g2.draw(e1); Ellipse2D.Double e2 new Ellipse2D.Double(100, 250, 90, 30); g2.setcolor(color.red); g2.fill(e2); Ellipse2D.Double e3 new Ellipse2D.Double(200, 50, 50, 50); Color c3 new Color(0, 0, 255); g2.setcolor(c3); g2.draw(e3); // B Point2D.Double p1 new Point2D.Double(250, 200); Point2D.Double p2 new Point2D.Double(300, 120); Line2D.Double lin new Line2D.Double(p1, p2); g2.draw(lin); AffineTransform at1 new AffineTransform(); at1.translate(50, 100); g2.transform(at1); g2.draw(r1); at1 new AffineTransform(); at1.rotate(math.toradians(20.0)); g2.transform(at1); g2.fill(r1); Figure4:Javacodetodrawsomeshapes. 7
8 Figure 5: Shapes. 8
9 4. (a) Eqn. 11 shows a Window to Viewport transformation. x d (Vxr V xl) (W xr W xl ) (x w W xl )+V xl, y d (V yt V yb ) (W yt W yb ) (y w W yb )+V yb. (11) Showthateqn.11isascalingplusatranslation,inotherwords,oftheformofeqn.12, witha 12 0,a [ [ [ [ xd a11 a 12 xw tx +. (12) a 21 a 22 y w t y y d Hint.Leta (Vxr V xl) (W xr W xl ) and,likewise,b (V yt V yb ) (W yt W yb ). [8marks (b)seefigure6whichshowsawindowandaviewportandacrudevehicleinthewindow. yw 5 Wyt5 4 3 c(2,4) (6, 5) 100 d(4,4) Vxl0, Vyt100 xd Wyb1 (1, 1) xw Wxl Wxr yd Vxr500, Vyb500 Window Viewport Figure 6: Window and viewport. Showthateqn.11willmap(1,1) (0,500)and(6,5) (500,100).Warning.Negative scaling for y. (c)computetheviewportcoordinatesofwindowpointsc(2,4)andd(4,4). [6 marks [6 marks (d)usetheresultsof(b)and(c),orotherwise,toshowhowthevehiclewillappearinthe viewport. [5 marks 9
10 5.Figure7showsJavacodethatdrawssomerotated,translatedandscaledversionsofa2D house; Figure 8 shows the resultant graphics. For brevity, we do not include createhouse; thetwostatementsjustafter// 1createanddrawtheoriginalofthehouseat(0,0). In the questions that follow, you need not bother setting line stroking/ stippling. (a)basedonthecodejustafter// (a),writeafragmentofcodewhich,usingan AffineTransform, willdrawthecopyofthehouseat(150,50);thecodewasremovedfromfigure7. [4 marks (b)revisethecodefollowing// (b)todrawthehouselyingonitssidewithitsbaseon they-axis asinthediagram,butusingasinglerotation. [4 marks (c)thecodeafter// (c)rotatestrhouse1whichisat(100,150). Explaintherotated positionandwhythehousedoesnottiltonitsbottomleftcornerlikerothouse1. [4 marks (d) Eqn. 13 shows a scaling transformation. Give the components of the scaling matrix that would result from// (d). Ignore the translation. [2 marks [ vx [ sx 0 0 s y [ ux. (13) (e)whatistheinverseofthescalingmatrixineqn.13? [2 marks (f) Using the results of(e) or otherwise, give the AffineTransform which will return the houseat(100, 20)toitsfullsize. [2 marks (g)eqn.14showsthematrixfora45 rotationandeqn.15thematrixfora90 rotation. Usematrixmultiplicationtoshowthattwo45 rotationsmakea90 rotation. [ cos45 sin45 sin45 cos45 [ cos90 sin90 sin90 cos90 [ [ [5 marks. (14). (15) (h)whatistheinverseofthe45 rotationmatrixandhowisitrelatedtoa 45 rotation matrix? [2 marks 10
11 g2.setpaint(color.black); // 1 Shape house createhouse(100, 120, 150); g2.draw(house); // (a) AffineTransform at1 new AffineTransform(); at1.translate(100, 150); Shape trhouse1 at1.createtransformedshape(house); Stroke stroke new BasicStroke(1, BasicStroke.CAP BUTT, BasicStroke.JOIN BEVEL, 0, new float[ 3, 3, 0); g2.setstroke(stroke); g2.draw(trhouse1); //code removed******************** // (b) at1 new AffineTransform(); at1.rotate(math.toradians(45.0)); Shape rothouse1 at1.createtransformedshape(house); stroke new BasicStroke(1, BasicStroke.CAP BUTT, BasicStroke.JOIN BEVEL, 0, new float[ 1, 1, 0); g2.setstroke(stroke); g2.draw(rothouse1); Shape rothouse3 at1.createtransformedshape(rothouse1); stroke new BasicStroke(1, BasicStroke.CAP BUTT, BasicStroke.JOIN BEVEL, 0, new float[ 1, 1, 0); g2.setstroke(stroke); g2.draw(rothouse3); // (c) Shape rothouse2 at1.createtransformedshape(trhouse1); stroke new BasicStroke(1, BasicStroke.CAP BUTT, BasicStroke.JOIN BEVEL, 0, new float[ 5, 5, 0); g2.setstroke(stroke); g2.draw(rothouse2); at1 new AffineTransform(); at1.translate(100,-20); at1.scale(1.0, 0.5); // (d) Shape scaledhouse at1.createtransformedshape(house); stroke new BasicStroke(1, BasicStroke.CAP BUTT, BasicStroke.JOIN BEVEL, 0, new float[ 5, 5, 0); g2.setstroke(stroke); g2.draw(scaledhouse); Figure 7: Java code to draw rotated, translated and scaled house drawings. 11
12 Figure 8: Houses. 12
13 6. (a)howcanparallaxscrollingbeusedtogivea3deffectina2dgame? [5 marks (b)figure10showsalevelmapfileforatile-basedgame. Thespriteandtileimagesare shown in Figure 9.(A background is displayed separately.) Figure 9: Sprites and tiles. 13
14 # Map file for tile-based game # (Lines that start with # are comments) # The tiles are: # (Space) Empty tile # A..Z Tiles A through Z # o Star #! Music Note # * Goal # 1 Bad Guy 1 (grub) # 2 Bad Guy 2 (fly) o o o o o o o o o o o o o o IIIIIII IIIIIII o o 2 o 2 2 2EF EF EGD EF 1 CD 1 1 EGAD * BBBBBBBBGHBBBBBBBGHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBGAAHBBBBBBBBBBB # # in (c) draw from here --- Figure 10: Map file for tile-based game GiveadetailedcommentaryonhowthecodeinFigures 11and 12usethelevelmap file to initialise the game display. [10 marks (c) Draw the right hand eight columns of the display to demonstrate that you understand themeaningofthemapfile. Question 6, part(d), continues on page 17. [4 marks 14
15 private TileMap loadmap(string filename) throws IOException ArrayList lines new ArrayList(); int width 0; int height 0; // read every line in the text file into the list BufferedReader reader new BufferedReader( new FileReader(filename)); while (true) String line reader.readline(); // no more lines to read if (line null) reader.close(); break; // add every line except for comments if (!line.startswith( # )) lines.add(line); width Math.max(width, line.length()); // parse the lines to create a TileEngine height lines.size(); TileMap newmap new TileMap(width, height); for (int y0; y height; y++) String line (String)lines.get(y); for (int x0; x line.length(); x++) char ch line.charat(x); // check if the char represents tile A, B, C etc. int tile ch - A ; if (tile 0 && tile tiles.size()) newmap.settile(x, y, (Image)tiles.get(tile)); // continued... Figure 11: Level reader for a sprite-tile-based game, part 1. 15
16 // four lines repeated... int tile ch - A ; if (tile 0 && tile tiles.size()) newmap.settile(x, y, (Image)tiles.get(tile)); // check if the char represents a sprite else if (ch o ) addsprite(newmap, coinsprite, x, y); else if (ch! ) addsprite(newmap, musicsprite, x, y); else if (ch * ) addsprite(newmap, goalsprite, x, y); else if (ch 1 ) addsprite(newmap, grubsprite, x, y); else if (ch 2 ) addsprite(newmap, flysprite, x, y); // add the player to the map Sprite player (Sprite)playerSprite.clone(); player.setx(tilemaprenderer.tilestopixels(3)); player.sety(0); newmap.setplayer(player); return newmap; private void addsprite(tilemap map, Sprite hostsprite, int tilex, int tiley) if (hostsprite! null) // clone the sprite from the host Sprite sprite (Sprite)hostSprite.clone(); // center the sprite sprite.setx( TileMapRenderer.tilesToPixels(tileX) + (TileMapRenderer.tilesToPixels(1) - sprite.getwidth()) / 2); // bottom-justify the sprite sprite.sety(tilemaprenderer.tilestopixels(tiley + 1) - sprite.getheight()); // add it to the map map.addsprite(sprite); Figure 12: Level reader for a sprite-tile-based game, part 2. 16
17 (d)explaintheuseofdrawinfigure13inupdatingthepositionsofanumberofsprites inagame.concentrateon// *1and// *2;besuretomentionthecircumstancesin which sprite.getvelocityx() 0 wouldbetrueandhowthetwolines: transform.scale(-1, 1); transform.translate(-sprite.getwidth(), 0); willaltertheappearanceofaspritesuchasgrub1orgrub2infigure9. [6 marks public void draw(graphics2d g) // draw background g.drawimage(bgimage, 0, 0, null); AffineTransform transform new AffineTransform(); for (int i 0; i NUM SPRITES; i++) Sprite sprite sprites[i; // *1 transform.settotranslation(sprite.getx(), sprite.gety()); // *2 if (sprite.getvelocityx() 0) transform.scale(-1, 1); transform.translate(-sprite.getwidth(), 0); // draw it g.drawimage(sprite.getimage(), transform, null); Figure 13: Sprite position updater. 17
18 Appendix A, Trigonometry. sin a opp / hyp y cos a adj / hyp P But hyp 1 so b 90 a r1 b sin a tan a sin a opp y a and cos a x cos a adj x. sin 0 0 cos 0 1 sin 90 1 cos 90 0 etc. Figure14:Sin,cosandandcircle. From Figure 14 we can see from Pythagoras s Theorem that sin 2 θ+cos 2 θ1. (16) Somevalues.sin0 0,sin30 0.5,sin60 3/20.866,sin90 1. cos0 1,cos30 3/20.866,cos60 0.5,cos90 0. Radians. Aradianisabout57 ;itistheanglesubtendedbyanarcoflengthronacircleofradiusr. π/2radians90,πradians180,2πradians360,etc. π Degrees,d,toradians,r:r(180/π) d. CosandSinareperiodicover2πradiansor360. cosandsinrepeatthemselvesafter2πradiansor360deg. Sinisanoddfunction:sin θ sinθ. Cosisanevenfunction:cos θcosθ. 18
19 Useful equations. sin(θ+φ) sinθcosφ+cosθsinφ, (17) sin(θ φ) sinθcosφ cosθsinφ, (18) cos(θ+φ) cosθcosφ sinθsinφ, (19) cos(θ φ) cosθcosφ+sinθsinφ. (20) sin 2 θ+cos 2 θ1. (21) sin 2 θ 1 (1 cos2θ). (22) 2 cos 2 θ 1 (1+cos2θ). (23) 2 cos2θcos 2 θ sin 2 θ1 sin 2 θ2cos 2 θ 1. (24) 19
20 Appendix B, 2D Linear Transformations. Scaling [ vx [ sx 0 0 s y [ ux. (25) Rotation [ vx [ cosb sinb sinb cosb [ ux. (26) Shear Shearalongthexaxis, [ vx [ 1 a 0 1 [ ux. (27) Shearalongtheyaxis, [ vx [ 1 0 b 1 [ ux. (28) Reflection Reflect about the y axis(x-coordinates are negated), [ [ [ vx 1 0 ux. (29) 0 1 Reflect about the x axis(y-coordinates are negated), [ [ vx [ ux. (30) Projection Projection onto x-axis, [ vx Projectionontothey-axis, [ vx [ [ [ ux [ ux. (31). (32) Translation [ vx [ tx t y [ ux +. (33) 20
21 Appendix C, 3D Affine Transformations using Homogeneous Coordinates. Translation v x v z v w t x t y t z u x u z u w. (34) Rotation about the z-axis Rotation about the x-axis Rotation about the y-axis R z (b) R x (b) R y (b) cosb sinb 0 0 sinb cosb cosb sinb 0 0 sinb cosb cosb 0 sinb sinb 0 cosb (35). (36). (37) 21
Letterkenny Institute of Technology
Letterkenny Institute of Technology BSc in Computing in Games Development Subject: Games Programming 1 Level: 7 Date: Autumn 2008 Examiners: Dr. J.G. Campbell Dr. M.D.J. McNeill Time Allowed: Two hours.
More informationCreating a 2D Platform Game
Content Creating a 2D Platform Game Chapter 5 Creating a TileBased Map Collision Detection Finishing Things Up and Making It Fast Creating an Executable.jar File Ideas to Expand the Game Summary 2 Introduction
More informationAffine Transformations. Transforming shape models Combining affine transformations Scene graphs, interactor trees Hit tests on transformed shapes
Affine Transformations Transforming shape models Combining affine transformations Scene graphs, interactor trees Hit tests on transformed shapes Reacll: Shape Models We can think of widgets as shape models
More informationEXAMINATIONS 2016 TRIMESTER 2
EXAMINATIONS 2016 TRIMESTER 2 CGRA 151 INTRODUCTION TO COMPUTER GRAPHICS Time Allowed: TWO HOURS CLOSED BOOK Permitted materials: Silent non-programmable calculators or silent programmable calculators
More informationSolution Notes. COMP 151: Terms Test
Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms
More informationMATHEMATICS FOR ENGINEERING TRIGONOMETRY
MATHEMATICS FOR ENGINEERING TRIGONOMETRY TUTORIAL SOME MORE RULES OF TRIGONOMETRY This is the one of a series of basic tutorials in mathematics aimed at beginners or anyone wanting to refresh themselves
More informationEXAMINATIONS 2017 TRIMESTER 2
EXAMINATIONS 2017 TRIMESTER 2 CGRA 151 INTRODUCTION TO COMPUTER GRAPHICS Time Allowed: TWO HOURS CLOSED BOOK Permitted materials: Silent non-programmable calculators or silent programmable calculators
More information2D and 3D Transformations AUI Course Denbigh Starkey
2D and 3D Transformations AUI Course Denbigh Starkey. Introduction 2 2. 2D transformations using Cartesian coordinates 3 2. Translation 3 2.2 Rotation 4 2.3 Scaling 6 3. Introduction to homogeneous coordinates
More informationJava 2D Graphics. Drawing Primitives, Affine Transformations, Scene Graphs, Hit Tests. Drawing Primitives 2/9/2014. Using it is simple.
Java 2D Graphics Drawing Primitives, Affine Transformations, Scene Graphs, Hit Tests Drawing Primitives Graphics - Abstract Base Class that supports basic drawing and rendering - Conceptually sim. to WatGUI
More informationAppendix D Trigonometry
Math 151 c Lynch 1 of 8 Appendix D Trigonometry Definition. Angles can be measure in either degree or radians with one complete revolution 360 or 2 rad. Then Example 1. rad = 180 (a) Convert 3 4 into degrees.
More informationComputer Science 336 Fall 2017 Homework 2
Computer Science 336 Fall 2017 Homework 2 Use the following notation as pseudocode for standard 3D affine transformation matrices. You can refer to these by the names below. There is no need to write out
More informationGraphics Transformations
Graphics Transformations Translate, Scale, Rotate Homogeneous Coordinates Affine Transformation Matrices Combining Transformations Shape Model Class 2.7 Graphics Transformations 1 Positioning Shapes Translate
More informationMath 7 Elementary Linear Algebra PLOTS and ROTATIONS
Spring 2007 PLOTTING LINE SEGMENTS Math 7 Elementary Linear Algebra PLOTS and ROTATIONS Example 1: Suppose you wish to use MatLab to plot a line segment connecting two points in the xy-plane. Recall that
More informationGraphics Hit-testing. Shape Models Selecting Lines and Shapes. 2.7 Graphics Hit-testing 1
Graphics Hit-testing Shape Models Selecting Lines and Shapes 2.7 Graphics Hit-testing 1 Recap - Graphic Models and Images Computer Graphics is the creation, storage, and manipulation of images and their
More informationJava How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved.
Java How to Program, 9/e Copyright 1992-2012 by Pearson Education, Inc. All Rights Reserved. Overview capabilities for drawing two-dimensional shapes, controlling colors and controlling fonts. One of
More informationAQA GCSE Further Maths Topic Areas
AQA GCSE Further Maths Topic Areas This document covers all the specific areas of the AQA GCSE Further Maths course, your job is to review all the topic areas, answering the questions if you feel you need
More informationpublic void paintcomponent(graphics g) { Graphics2D g2 = (Graphics2D)g;... }
6.1 RANDERING The original JDK 1.0 had a very simple mechanism for drawing shapes. You select color and paint mode, and call methods of the Graphics class such as drawrect or filloval. The Java 2D API
More informationMATHEMATICS FOR ENGINEERING TUTORIAL 5 COORDINATE SYSTEMS
MATHEMATICS FOR ENGINEERING TUTORIAL 5 COORDINATE SYSTEMS This tutorial is essential pre-requisite material for anyone studying mechanical engineering. This tutorial uses the principle of learning by example.
More informationAnswers to practice questions for Midterm 1
Answers to practice questions for Midterm Paul Hacking /5/9 (a The RREF (reduced row echelon form of the augmented matrix is So the system of linear equations has exactly one solution given by x =, y =,
More information2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University
2D Image Transforms 16-385 Computer Vision (Kris Kitani) Carnegie Mellon University Extract features from an image what do we do next? Feature matching (object recognition, 3D reconstruction, augmented
More informationGraphics and Interaction Transformation geometry and homogeneous coordinates
433-324 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation
More informationCOMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates
COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation
More informationSoftware System Components 1 Graphics
Software System Components 1 Graphics Shan He LECTURE 3 Introduction to Java 2D Graphics (II) 1.1. Outline of Lecture Review of what we learned Rendering Shapes 1.2. Review of what we learned Last lecture,
More information6.3 Converting Between Systems
www.ck1.org Chapter 6. The Polar System 6. Converting Between Systems Learning Objectives Convert rectangular coordinates to polar coordinates. Convert equations given in rectangular form to equations
More information(C) 2010 Pearson Education, Inc. All rights reserved. Omer Boyaci
Omer Boyaci A sprite must monitor the game environment, for example, reacting to collisions with different sprites or stopping when it encounters an obstacle. Collision processing can be split into two
More informationTo graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:
Polar Coordinates Any point in the plane can be described by the Cartesian coordinates (x, y), where x and y are measured along the corresponding axes. However, this is not the only way to represent points
More informationWeek 4 Part 2. Introduction to 2D Graphics & Java 2D
Week 4 Part 2 Introduction to 2D Graphics & Java 2D 2D graphics Vector graphics! Use of geometric primitives: points, lines, curves, etc.! Primitives are created by using mathematical equations! Can be
More informationVector Addition. Qty Item Part Number 1 Force Table ME-9447B 1 Mass and Hanger Set ME Carpenter s level 1 String
rev 05/2018 Vector Addition Equipment List Qty Item Part Number 1 Force Table ME-9447B 1 Mass and Hanger Set ME-8979 1 Carpenter s level 1 String Purpose The purpose of this lab is for the student to gain
More informationOverview. Java2D. Graphics in Java2D: Colour Images Fonts. The bigger picture of Java Graphics: Java Advanced Imaging (JAI) API Java3D
Graphics in Java2D: Colour Images Fonts Overview The bigger picture of Java Graphics: Java Advanced Imaging (JAI) API Java3D The bigger picture of Java multimedia ITNP80: Multimedia 1 ITNP80: Multimedia
More informationCopyrighted by Gabriel Tang B.Ed., B.Sc. Page 167.
lgebra Chapter 8: nalytical Trigonometry 8- Inverse Trigonometric Functions Chapter 8: nalytical Trigonometry Inverse Trigonometric Function: - use when we are given a particular trigonometric ratio and
More information2D TRANSFORMATIONS AND MATRICES
2D TRANSFORMATIONS AND MATRICES Representation of Points: 2 x 1 matrix: x y General Problem: B = T A T represents a generic operator to be applied to the points in A. T is the geometric transformation
More informationCS 4300 Computer Graphics. Prof. Harriet Fell Fall 2012 Lecture 5 September 13, 2012
CS 4300 Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 5 September 13, 2012 1 Today s Topics Vectors review Shirley et al. 2.4 Rasters Shirley et al. 3.0-3.2.1 Rasterizing Lines Shirley et al.
More informationCalculus III. Math 233 Spring In-term exam April 11th. Suggested solutions
Calculus III Math Spring 7 In-term exam April th. Suggested solutions This exam contains sixteen problems numbered through 6. Problems 5 are multiple choice problems, which each count 5% of your total
More informationAlgebra II. Slide 1 / 162. Slide 2 / 162. Slide 3 / 162. Trigonometric Functions. Trig Functions
Slide 1 / 162 Algebra II Slide 2 / 162 Trigonometric Functions 2015-12-17 www.njctl.org Trig Functions click on the topic to go to that section Slide 3 / 162 Radians & Degrees & Co-terminal angles Arc
More informationTransformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico
Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Angel: Interactive Computer Graphics 4E Addison-Wesley 25 1 Objectives
More informationSec 4.1 Trigonometric Identities Basic Identities. Name: Reciprocal Identities:
Sec 4. Trigonometric Identities Basic Identities Name: Reciprocal Identities: Quotient Identities: sin csc cos sec csc sin sec cos sin tan cos cos cot sin tan cot cot tan Using the Reciprocal and Quotient
More informationMathematics for Computer Graphics. Trigonometry
Mathematics for Computer Graphics Trigonometry Trigonometry...????? The word trigonometry is derived from the ancient Greek language and means measurement of triangles. trigonon triangle + metron measure
More informationRight Triangle Trigonometry Definitions (Instructor Notes)
Right Triangle Trigonometry Definitions (Instructor Notes) This activity is designed for a 50 min. class. Materials: Triangles Print out the last 10 pages of this document. It helps to use different colors
More informationAdding vectors. Let s consider some vectors to be added.
Vectors Some physical quantities have both size and direction. These physical quantities are represented with vectors. A common example of a physical quantity that is represented with a vector is a force.
More informationGame Engineering: 2D
Game Engineering: 2D CS420-2010F-07 Objects in 2D David Galles Department of Computer Science University of San Francisco 07-0: Representing Polygons We want to represent a simple polygon Triangle, rectangle,
More informationA lg e b ra II. Trig o n o m e tric F u n c tio
1 A lg e b ra II Trig o n o m e tric F u n c tio 2015-12-17 www.njctl.org 2 Trig Functions click on the topic to go to that section Radians & Degrees & Co-terminal angles Arc Length & Area of a Sector
More informationComputer Graphics 7: Viewing in 3-D
Computer Graphics 7: Viewing in 3-D In today s lecture we are going to have a look at: Transformations in 3-D How do transformations in 3-D work? Contents 3-D homogeneous coordinates and matrix based transformations
More information2D Graphics. Shape Models, Drawing, Selection. CS d Graphics 1
2D Graphics Shape Models, Drawing, Selection 1 Graphic Models vs. Images Computer Graphics: the creation, storage, and manipulation of images and their models Model: a mathematical representation of an
More information2D transformations: An introduction to the maths behind computer graphics
2D transformations: An introduction to the maths behind computer graphics Lecturer: Dr Dan Cornford d.cornford@aston.ac.uk http://wiki.aston.ac.uk/dancornford CS2150, Computer Graphics, Aston University,
More informationHomogeneous Coordinates and Transformations of the Plane
2 Homogeneous Coordinates and Transformations of the Plane 2. Introduction In Chapter planar objects were manipulated by applying one or more transformations. Section.7 identified the problem that the
More informationOutline. Anonymous Classes. Annoucements. CS1007: Object Oriented Design and Programming in Java
Outline CS1007: Object Oriented Design and Programming in Java Lecture #9 Oct 6 Shlomo Hershkop shlomo@cs.columbia.edu Polymorphism Basic graphics Layout managers Customization Reading: 4.5-4.8, 4.9 1
More informationTo graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6
Polar Coordinates Any point in the plane can be described by the Cartesian coordinates (x, y), where x and y are measured along the corresponding axes. However, this is not the only way to represent points
More informationReview of Trigonometry
Worksheet 8 Properties of Trigonometric Functions Section Review of Trigonometry This section reviews some of the material covered in Worksheets 8, and The reader should be familiar with the trig ratios,
More informationComputer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms
Chapter IV Spaces and Transforms Scaling 2D scaling with the scaling factors, s x and s y, which are independent. Examples When a polygon is scaled, all of its vertices are processed by the same scaling
More informationComputer Graphics Geometric Transformations
Computer Graphics 2016 6. Geometric Transformations Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2016-10-31 Contents Transformations Homogeneous Co-ordinates Matrix Representations of Transformations
More informationICOM 4015 Advanced Programming Laboratory. Chapter 3 Introduction to Graphical Applications in Java using Swing
ICOM 4015 Advanced Programming Laboratory Chapter 3 Introduction to Graphical Applications in Java using Swing University of Puerto Rico Electrical and Computer Engineering Department by Juan E. Surís
More informationLesson 27: Angles in Standard Position
Lesson 27: Angles in Standard Position PreCalculus - Santowski PreCalculus - Santowski 1 QUIZ Draw the following angles in standard position 50 130 230 320 770-50 2 radians PreCalculus - Santowski 2 Fast
More informationCoordinate Transformations in Advanced Calculus
Coordinate Transformations in Advanced Calculus by Sacha Nandlall T.A. for MATH 264, McGill University Email: sacha.nandlall@mail.mcgill.ca Website: http://www.resanova.com/teaching/calculus/ Fall 2006,
More informationCISC 1600, Lab 2.1: Processing
CISC 1600, Lab 2.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using Sketchpad, a site for building processing sketches online using processing.js. 1.1. Go to http://cisc1600.sketchpad.cc
More informationAffine Transformation. Edith Law & Mike Terry
Affine Transformation Edith Law & Mike Terry Graphic Models vs. Images Computer Graphics: the creation, storage and manipulation of images and their models Model: a mathematical representation of an image
More informationOverview. Affine Transformations (2D and 3D) Coordinate System Transformations Vectors Rays and Intersections
Overview Affine Transformations (2D and 3D) Coordinate System Transformations Vectors Rays and Intersections ITCS 4120/5120 1 Mathematical Fundamentals Geometric Transformations A set of tools that aid
More information1. Complete these exercises to practice creating user functions in small sketches.
Lab 6 Due: Fri, Nov 4, 9 AM Consult the Standard Lab Instructions on LEARN for explanations of Lab Days ( D1, D2, D3 ), the Processing Language and IDE, and Saving and Submitting. Rules: Do not use the
More informationTo specify the dimensions of the drawing canvas use the size statement: ! size( 300, 400 );
Study Guide We have examined three main topics: drawing static pictures, drawing simple moving pictures, and manipulating images. The Final Exam will be concerned with each of these three topics. Each
More informationAlgebra II Trigonometric Functions
Slide 1 / 162 Slide 2 / 162 Algebra II Trigonometric Functions 2015-12-17 www.njctl.org Slide 3 / 162 Trig Functions click on the topic to go to that section Radians & Degrees & Co-terminal angles Arc
More informationCLEP Pre-Calculus. Section 1: Time 30 Minutes 50 Questions. 1. According to the tables for f(x) and g(x) below, what is the value of [f + g]( 1)?
CLEP Pre-Calculus Section : Time 0 Minutes 50 Questions For each question below, choose the best answer from the choices given. An online graphing calculator (non-cas) is allowed to be used for this section..
More informationAP CALCULUS BC 2014 SCORING GUIDELINES
SCORING GUIDELINES Question The graphs of the polar curves r = and r = sin ( θ ) are shown in the figure above for θ. (a) Let R be the shaded region that is inside the graph of r = and inside the graph
More informationWarm Up: please factor completely
Warm Up: please factor completely 1. 2. 3. 4. 5. 6. vocabulary KEY STANDARDS ADDRESSED: MA3A2. Students will use the circle to define the trigonometric functions. a. Define and understand angles measured
More informationProcessing Transformations. Affine Transformations
Processing Transformations Affine Transformations 1 A house size(200, 200); rect(50, 75, 100, 75); // (left, top, w, h) rect(100, 110, 20, 40); // door rect(70, 110, 15, 15); //window triangle(50, 75,
More informationSpecifying Complex Scenes
Transformations Specifying Complex Scenes (x,y,z) (r x,r y,r z ) 2 (,,) Specifying Complex Scenes Absolute position is not very natural Need a way to describe relative relationship: The lego is on top
More informationSNAP Centre Workshop. Introduction to Trigonometry
SNAP Centre Workshop Introduction to Trigonometry 62 Right Triangle Review A right triangle is any triangle that contains a 90 degree angle. There are six pieces of information we can know about a given
More informationIS311 Programming Concepts J AVA. Abstract Window Toolkit. (part 2: Graphics2D)
IS311 Programming Concepts J AVA Abstract Window Toolkit (part 2: Graphics2D) Graphics2D เป น subclass ของ Graphics เพ มความสามารถ ในการควบค มร ปทรงเรขาคณ ตท ซ บซ อนมากข น เช น Draw lines of any thickness
More informationMATH EXAM 1 - SPRING 2018 SOLUTION
MATH 140 - EXAM 1 - SPRING 018 SOLUTION 8 February 018 Instructor: Tom Cuchta Instructions: Show all work, clearly and in order, if you want to get full credit. If you claim something is true you must
More informationTrigonometry Ratios. For each of the right triangles below, the labelled angle is equal to 40. Why then are these triangles similar to each other?
Name: Trigonometry Ratios A) An Activity with Similar Triangles Date: For each of the right triangles below, the labelled angle is equal to 40. Why then are these triangles similar to each other? Page
More information1. (10 pts) Order the following three images by how much memory they occupy:
CS 47 Prelim Tuesday, February 25, 2003 Problem : Raster images (5 pts). (0 pts) Order the following three images by how much memory they occupy: A. a 2048 by 2048 binary image B. a 024 by 024 grayscale
More informationGuided Problem Solving
-1 Guided Problem Solving GPS Student Page 57, Exercises 1 1: Match each rule with the correct translation. A. (x, y) (x, y 1 ) I. P(, 1) P (3, ) B. (x, y) (x 1 3, y) II. Q(3, 0) Q (3, ) C. (x, y) (x 1,
More informationLesson 5.6: Angles in Standard Position
Lesson 5.6: Angles in Standard Position IM3 - Santowski IM3 - Santowski 1 Fast Five Opening Exercises! Use your TI 84 calculator:! Evaluate sin(50 ) " illustrate with a diagram! Evaluate sin(130 ) " Q
More information2D Graphics. Shape Models, Drawing, Selection. CS d Graphics 1
2D Graphics Shape Models, Drawing, Selection 1 Graphic Models vs. Images Computer Graphics: the creation, storage, and manipulation of images and their models Model: a mathematical representation of an
More informationCoordinate transformations. 5554: Packet 8 1
Coordinate transformations 5554: Packet 8 1 Overview Rigid transformations are the simplest Translation, rotation Preserve sizes and angles Affine transformation is the most general linear case Homogeneous
More informationLast week. Machiraju/Zhang/Möller/Fuhrmann
Last week Machiraju/Zhang/Möller/Fuhrmann 1 Geometry basics Scalar, point, and vector Vector space and affine space Basic point and vector operations Sided-ness test Lines, planes, and triangles Linear
More informationComputer Games 2012 Game Development
Computer Games 2012 Game Development Dr. Mathias Lux Klagenfurt University This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Agenda Game Loop Sprites & 2.5D Images
More informationand how to label right triangles:
Grade 9 IGCSE A1: Chapter 6 Trigonometry Items you need at some point in the unit of study: Graph Paper Exercise 2&3: Solving Right Triangles using Trigonometry Trigonometry is a branch of mathematics
More informationClass Meeting 05 (Lecture 04) Objectives for this class meeting. Conduct vote on basic style of game for class project
CSE1720 Click to edit Master Week text 02, styles Class Meeting 05 (Lecture 04) Second level Third level Fourth level Fifth level Winter 2013 Thursday, January 17, 2013 1 Objectives for this class meeting
More informationUNIT 2 2D TRANSFORMATIONS
UNIT 2 2D TRANSFORMATIONS Introduction With the procedures for displaying output primitives and their attributes, we can create variety of pictures and graphs. In many applications, there is also a need
More informationCISC 1600, Lab 3.1: Processing
CISC 1600, Lab 3.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using OpenProcessing, a site for building processing sketches online using processing.js. 1.1. Go to https://www.openprocessing.org/class/57767/
More informationTrigonometry I. Exam 0
Trigonometry I Trigonometry Copyright I Standards 006, Test Barry Practice Mabillard. Exam 0 www.math0s.com 1. The minimum and the maximum of a trigonometric function are shown in the diagram. a) Write
More informationCh. 2 Trigonometry Notes
First Name: Last Name: Block: Ch. Trigonometry Notes.0 PRE-REQUISITES: SOLVING RIGHT TRIANGLES.1 ANGLES IN STANDARD POSITION 6 Ch..1 HW: p. 83 #1,, 4, 5, 7, 9, 10, 8. - TRIGONOMETRIC FUNCTIONS OF AN ANGLE
More information10.1 Curves Defined by Parametric Equations
10.1 Curves Defined by Parametric Equations Ex: Consider the unit circle from Trigonometry. What is the equation of that circle? There are 2 ways to describe it: x 2 + y 2 = 1 and x = cos θ y = sin θ When
More informationCISC 1600 Lecture 3.1 Introduction to Processing
CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists
More informationSolve 3-D problems using Pythagoras theorem and trigonometric ratios (A*) Solve more complex 2-D problems using Pythagoras theorem & trigonometry (A)
Moving from A to A* Solve 3-D problems using Pythagoras theorem and trigonometric ratios (A*) A* Use the sine & cosine rules to solve more complex problems involving non right-angled triangles (A*) Find
More informationKevin James. MTHSC 206 Section 15.6 Directional Derivatives and the Gra
MTHSC 206 Section 15.6 Directional Derivatives and the Gradient Vector Definition We define the directional derivative of the function f (x, y) at the point (x 0, y 0 ) in the direction of the unit vector
More informationAP * Calculus Review. Area and Volume
AP * Calculus Review Area and Volume Student Packet Advanced Placement and AP are registered trademark of the College Entrance Examination Board. The College Board was not involved in the production of,
More information2D Object Definition (1/3)
2D Object Definition (1/3) Lines and Polylines Lines drawn between ordered points to create more complex forms called polylines Same first and last point make closed polyline or polygon Can intersect itself
More informationPrerequisites for Math 130
Prerequisites for Math 0 The material below represents only some of the basic material with which you should be familiar We will not be reviewing this material You may wish to consult Appendix A in your
More informationPLANE TRIGONOMETRY Exam I September 13, 2007
Name Rec. Instr. Rec. Time PLANE TRIGONOMETRY Exam I September 13, 2007 Page 1 Page 2 Page 3 Page 4 TOTAL (10 pts.) (30 pts.) (30 pts.) (30 pts.) (100 pts.) Below you will find 10 problems, each worth
More informationProgramming Graphics (P1 2006/2007)
Programming Graphics (P1 2006/2007) Fernando Brito e Abreu (fba@di.fct.unl.pt) Universidade Nova de Lisboa (http://www.unl.pt) QUASAR Research Group (http://ctp.di.fct.unl.pt/quasar) Chapter Goals To be
More informationAssignment #6: Subspaces of R n, Bases, Dimension and Rank. Due date: Wednesday, October 26, 2016 (9:10am) Name: Section Number
Assignment #6: Subspaces of R n, Bases, Dimension and Rank Due date: Wednesday, October 26, 206 (9:0am) Name: Section Number Assignment #6: Subspaces of R n, Bases, Dimension and Rank Due date: Wednesday,
More informationMA 154 PRACTICE QUESTIONS FOR THE FINAL 11/ The angles with measures listed are all coterminal except: 5π B. A. 4
. If θ is in the second quadrant and sinθ =.6, find cosθ..7.... The angles with measures listed are all coterminal except: E. 6. The radian measure of an angle of is: 7. Use a calculator to find the sec
More informationS U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T
S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T Copyright 2018 Sung-eui Yoon, KAIST freely available on the internet http://sglab.kaist.ac.kr/~sungeui/render
More informationCS 130 Final. Fall 2015
CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying
More informationModule Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1
UNIVERSITY OF EAST ANGLIA School of Computing Sciences Main Series UG Examination 217-18 GRAPHICS 1 CMP-51B Time allowed: 2 hours Answer THREE from FOUR questions (4 marks each) Notes are not permitted
More information521493S Computer Graphics Exercise 2 Solution (Chapters 4-5)
5493S Computer Graphics Exercise Solution (Chapters 4-5). Given two nonparallel, three-dimensional vectors u and v, how can we form an orthogonal coordinate system in which u is one of the basis vectors?
More informationMATH 31A HOMEWORK 9 (DUE 12/6) PARTS (A) AND (B) SECTION 5.4. f(x) = x + 1 x 2 + 9, F (7) = 0
FROM ROGAWSKI S CALCULUS (2ND ED.) SECTION 5.4 18.) Express the antiderivative F (x) of f(x) satisfying the given initial condition as an integral. f(x) = x + 1 x 2 + 9, F (7) = 28.) Find G (1), where
More informationPre-Calc Unit 14: Polar Assignment Sheet April 27 th to May 7 th 2015
Pre-Calc Unit 14: Polar Assignment Sheet April 27 th to May 7 th 2015 Date Objective/ Topic Assignment Did it Monday Polar Discovery Activity pp. 4-5 April 27 th Tuesday April 28 th Converting between
More informationCCNY Math Review Chapters 5 and 6: Trigonometric functions and graphs
Ch 5. Trigonometry 6. Angles 6. Right triangles 6. Trig funs for general angles 5.: Trigonometric functions and graphs 5.5 Inverse functions CCNY Math Review Chapters 5 and 6: Trigonometric functions and
More informationGraphics in Swing. Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland
Graphics in Swing Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland 1 paintcomponent and repaint Each Swing component has the following paint methods: void paintcomponent(
More information