Basic Graphics Drawing Shapes 2.

Slides:



Advertisements
Similar presentations
Microsoft® Small Basic
Advertisements

Lesson One: The Beginning
Introduction to Programming
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
THE ELLIPSE. The Ellipse Figure 1 is ellipse. Distance AB and CD are major and minor axes respectively. Half of the major axis struck as a radius from.
Packaging Design: Net This net is for an octagonal based prism. As with all technical drawings, the equipment goes a long way in helping you to draw a.
Area of a Sector and Arc Length Geometry BowerPower.net Mr. Bower.
constructions A Straight Line constructions Task: Task: Construct a line XY of length 5.9 cm. X  Construct a line more than 5.9 cm long (about 8 cm).
Packaging Project Net construction This is an example of constructing a net of a complex shape (Hexagonal based pyramid) using a compass drawing equipment.
GUI and Swing, part 2 The illustrated edition. Scroll bars As we have previously seen, a JTextArea has a fixed size, but the amount of text that can be.
1 L38 Graphics and Java 2D™ (3). 2 OBJECTIVES In this chapter you will learn:  To understand graphics contexts and graphics objects.  To understand.
Chapter Create Design Ms. Robin. You will learn: To create a design and identify the coordinates used to make the design. Identify the coordinates.
This presentation will cover your LCD screen with several solid colors, one at a time. This makes it fairly easy to see stuck (always on or off) pixels.
Week 2 Book Chapter 1 RGB Color codes. 2 2.Additive Color Mixing RGB The mixing of “ light ” Primary: Red, Green, Blue The complementary color “ White.
Chapter 15 Graphics and Java 2D™ Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 28 - Java Graphics and Java2D Outline 28.1Introduction.
Chapter 28 - Java Graphics and Java2D Outline 28.1Introduction 28.2Graphics Contexts and Graphics Objects 28.3Color Control 28.4Font Control 28.5Drawing.
 Pearson Education, Inc. All rights reserved. 1 Ch 12 Graphics and Java 2D In this chapter you will learn:  To understand graphics contexts.
Image Synthesis Rabie A. Ramadan, PhD D Images.
Element. The element Used to dynamically draw graphics using javascript. Capable of drawing paths, circles, rectangles, text, and images.
Image Representation. Objectives  Bitmaps: resolution, colour depth and simple bitmap file calculations.  Vector graphics: drawing list – objects and.
Chapter 7 Graphics. © Daly and Wrigley Objectives Use Graphic Components: ▫ Strings ▫ Lines ▫ Rectangles ▫ Ovals ▫ Arcs Change the color and font of elements.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
Lecture 2: Some definitions of terms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Lesson 3: Rotating Shapes. Some Things to Remember… Visualize how the shape is rotating Visualize how the shape is rotating What is a 90° turn? What is.
GRAPHICS MODULE 14 STUDY BOOK. Graphic commands SCREEN - puts the screen into graphics mode WINDOW - allows scaling of the screen LINE - 3 formats –LINE.
Introduction to Java Chapter 8 - Introduction to Java Graphics1 Chapter 8 Introduction to Java Graphics.
COMPUTER GRAPHICS. Can refer to the number of pixels in a bitmapped image Can refer to the number of pixels in a bitmapped image The amount of space it.
Graphics and Java2D Chapter Java Coordinate System Origin is in _____________ corner –Behind title bar of window X values increase to the ________.
CPSC 217 T03 Week II Part #1: SimpleGraphics.py Hubert (Sathaporn) Hu.
1 A Simple Applet. 2 Applets and applications An applet is a Java program that runs on a web page Applets can be run within any modern browser To run.
RGB lesson Mrs Ras. Open illustrator File > new change color mode to RGB.
PART TWO Electronic Color & RGB values 1. Electronic Color Computer Monitors: Use light in 3 colors to create images on the screen Monitors use RED, GREEN,
07 – HTML5 Canvas (1) Informatics Department Parahyangan Catholic University.
Basic Graphics 03/03/16 & 03/07/16 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
3. Drawing Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
Graphics Drawing Things With Java. Today's Topics Course Updates Java Graphics –Java 1.1 versus Java 1.2 (Java 2) Drawing Lines Drawing Shapes.
Introduction to Processing David Meredith Aalborg University Art &Technology, 3rd Semester Programming.
Computer Systems Nat 5 Computing Science Data Representation
Unit 2.6 Data Representation Lesson 3 ‒ Images
Circles Game.
12 Graphics and Java 2D™.
Graphical Output Basic Images.
Pixels, Colors and Shapes
What colour?.
9. Drawing.
South African Flag The South African flag contains the most colours of any national flag. Can you colour it in here? RED WHITE YELLOW WHITE BLACK GREEN.
Graphical Output Graphical Text.
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
JAVA 2 Design and programming of GUI
Microsoft® Small Basic
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Construct-a- snowflake.
Basic Graphics Drawing Shapes 1.
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
reading: Art & Science of Java, Ch. 9
The Canvas.
Colours.
The Bright Light By Yan Shan and Andre.
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Introduction to Turtle Graphics
What Color is it?.
Computer Systems Nat 4/5 Data Representation Lesson 4:
Reflect the shapes in the mirror lines
Circles.
BSI Symbols for Graphic Communication
Shapes.
POWERPOINT PRESENTATION
Year 8 Unit 2 Bitmap Graphics
Presentation transcript:

Basic Graphics Drawing Shapes 2

Learning Goals By the end of the lesson you should know: How to draw an ellipse How to draw a filled ellipse How to drawn an arc How to draw a filled arc

Draw an Ellipse Draw.Ellipse(gfx,400,300,200,100,3,Helper.RED,0.5f) Draw.Ellipse(gfx, x, y, xRadius, yRadius, lineWidth, Color, transparency) gfx represents your game window, leave this alone x, y is the coordinate of the centre of the ellipse xRadius, yRadius are the horiztonal and vertical radii length of the ellipse respectively lineWidth is the number of pixels wide the border is Color is the colour of the ellipse, e.g. Helper.RED transparency is how see-through the border is, a float number from 0 to 1 where 0 is invisible Example: Draw a red ellipse at (400,300) that is 200 pixels wide and 100 tall. The ellipse is half transparent and 3 pixels wide Draw.Ellipse(gfx,400,300,200,100,3,Helper.RED,0.5f)

Draw a Filled Ellipse Draw.FillEllipse(gfx, x, y, xRadius, yRadius, color, transparency) gfx represents your game window, leave this alone x,y is the coordinate for the centre of the ellipse xRadius, yRadius are the horiztonal and vertical radii length of the ellipse respectively color is the colour the ellipse is filled in with transparency is how see-through the ellipse is, a float number from 0 to 1 where 0 is invisible Example: Draw an opaque white ellipse at (400,300) that is 100 pixels wide and 200 tall. The ellipse is 5 pixels wide Draw.FillEllipse(gfx,400,30,100,200,Helper.WHITE,0.5f);

Draw an Arc Draw.Arc(gfx,x,y,xRadius,yRadius,startAngle,angleDuration,arcType,lineWidth,Color,transparency) An Arc is simply an ellipse that doesn’t go all the way around gfx represents your game window, leave this alone x, y is the coordinate of the centre of the arc xRadius, yRadius are the horiztonal and vertical radii length of the arc respectively startAngle is the to start the arc at angleDuration is the number of degrees to continue the arc for arcType is one of three types of arc to draw: Arc2D.PIE (shaped like a pizza slice) Arc2D.CHORD (Draws a straight line joining the start and end point) Arc2D.Open (Draws only the Arc itself) lineWidth is the number of pixels wide the border is Color is the colour of the arc, e.g. Helper.RED transparency is how see-through the border is, a float number from 0 to 1 where 0 is invisible Example: Draw an opaque blue arc at (700,500) that is 50 pixels wide and 100 tall. The arc has a border of 5 pixels, starts at 45o and runs for 90o (will end at 135o). The arc will be pizza shaped. Draw.Arc(gfx,700,500,50,100,45,90,Arc2D.PIE,5,Helper.BLUE,1f)

Draw a Filled Arc Draw.FillArc(gfx,x,y,xRadius,yRadius,startAngle,angleDuration,arcType,Color,transparency) An Arc is simply an ellipse that doesn’t go all the way around gfx represents your game window, leave this alone x, y is the coordinate of the centre of the arc xRadius, yRadius are the horiztonal and vertical radii length of the arc respectively startAngle is the to start the arc at angleDuration is the number of degrees to continue the arc for arcType is one of three types of arc to draw: Arc2D.PIE (shaped like a pizza slice) Arc2D.CHORD (Draws a straight line joining the start and end point) Arc2D.Open (Draws only the Arc itself) Color is the colour of the arc, e.g. Helper.RED transparency is how see-through the border is, a float number from 0 to 1 where 0 is invisible Example: Draw a ¾ opaque yellow arc at (700,500) that is 100 pixels wide and 50 tall. The arc has a border of 5 pixels, starts at 30o and runs for 300o (will end at 330o). The arc will be pizza shaped. Draw.FillArc(gfx,700,500,100,50,30,300,Arc2D.PIE,Helper.YELLOWE,0.75f)