Lecture 6 Data Structures & Drawing. Objective The objective is that you will understand: How to program the generation of 2D and 3D images. How to manipulate.

Slides:



Advertisements
Similar presentations
Objectives Build and modify an organization chart.
Advertisements

Lecture 7 2D Transformation. What is a transformation? Exactly what it says - an operation that transforms or changes a shape (line, shape, drawing etc.)
Mobile and Wireless Computing Institute for Computer Science, University of Freiburg Western Australian Interactive Virtual Environments Centre (IVEC)
Section 3-1 to 3-2, 3-5 Drawing Lines Some of the material in these slides may have been adapted from university of Virginia, MIT, and Åbo Akademi University.
12 VECTORS AND THE GEOMETRY OF SPACE.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Creation of the Boundary Path Jonathan Misurda Math 1110 February 11, 2002.
TRANSFORMATIONS Reflections Rotations Enlargements Translations.
1 Computer Graphics Chapter 7 3D Object Modeling.
CS 128/ES Lecture 5b1 Vector Based Data. CS 128/ES Lecture 5b2 Spatial data models 1.Raster 2.Vector 3.Object-oriented Spatial data formats:
Cmput Lecture 15 Department of Computing Science University of Alberta ©Duane Szafron 2000 Some code in this lecture is based on code from the book:
SWE 423: Multimedia Systems Chapter 4: Graphics and Images.
Introduction to OpenGL. What is OpenGL OpenGL is a low-level software interface to graphics hardware No commands for performing windowing tasks or obtaining.
Transformation. A We are given a shape on the axis…shape A And we are told to move the whole shape 4 squares to the right, and 6 squares up translation.
Pasewark & Pasewark 1 Word Lesson 6 Working with Graphics Microsoft Office 2007: Introductory.
Microsoft Office 2007: Introductory 1 Word Lesson 6 Working with Graphics Computer Applications 1.
COMP 175: Computer Graphics March 24, 2015
ME 2304: 3D Geometry & Vector Calculus Dr. Faraz Junejo Line Integrals.
G050: Lecture 02 Evaluating Interactive Multimedia Products
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
Shadows via Projection Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, November 5, 2003.
 A Collection class is a data type that is capable of holding a group of items.  In Java, Collection classes can be implemented as a class, along with.
Vector Graphics Multimedia Technology. Object Orientated Data Types Created on a computer not by sampling real world information Details are stored on.
Translations, Rotations, Reflections, and Dilations.
Computing Actual Areas from a Scale Drawing.
Holt Geometry 1-7 Transformations in the Coordinate Plane Warm Up 1.Which describes a translation? a) Turnb) Flipc) Slide 2. Which describes a rotation?
Solid Modeling. Solid Modeling - Polyhedron A polyhedron is a connected mesh of simple planar polygons that encloses a finite amount of space. A polyhedron.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
Transformations Objective: to develop an understanding of the four transformations. Starter – if 24 x 72 = 2016, find the value of: 1)2.8 x 72 = 2)2.8.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
Before we do any of these, let's make sure we understand the sets. A, B, and C are subsets of U. May 2001: Paper 2 #1 The sets A, B, and C are subsets.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Word Lesson 6 Working with Graphics
Images.  Images include graphics, such as backgrounds, color schemes and navigation bars, and photos and other illustrations  An essential part of a.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
WHICH IS WHICH? WHAT CAN WE DO TO REMEMBER? Look at reflection, translation and rotation.
Week 2 - Friday.  What did we talk about last time?  Computing Big Oh.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
Multiplication of Common Fractions © Math As A Second Language All Rights Reserved next #6 Taking the Fear out of Math 1 3 ×1 3 Applying.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
THE NATURE OF SETS Copyright © Cengage Learning. All rights reserved. 2.
Foundations of Art. What is it and why do we need to use it in art? VALUE- refers to the lightness or darkness of a color. It is needed to express volume.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
Computer Graphics.
Linked Lists in Action Chapter 5 introduces the often-used data public classure of linked lists. This presentation shows how to implement the most common.
Chapter 5: MACHINATIONS
CSI-447: Multimedia Systems
Objectives Identify reflections, rotations, and translations.
Dr. Jim Rowan ITEC 2110 Wednesday, September 12
LO To assess my understanding of transformations
FP1 Matrices Transformations
Digital Media Dr. Jim Rowan ITEC 2110.
Viewing and Perspective Transformations
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Eureka Math 8th Grade Module 2
Golden Mean/Fibonacci Art
Lecture 8 Exercise 8 1. Describe similarities and differences between a network bridge and Internet router. 2. Describe similarities and differences between.
Question 13.
Type of cell division:
A rotation has to have three elements…
Two transformations are applied to a hexagon.
A rotation has to have three elements…
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Presentation transcript:

Lecture 6 Data Structures & Drawing

Objective The objective is that you will understand: How to program the generation of 2D and 3D images. How to manipulate those images through scaling, translation, rotation and projection. How to color and shade the images. Remove hidden surfaces and create realistic lighting effects. Before any of that however, we must learn more about how to describe a drawing in terms that a computer can understand.

The Basic 2d data structure – Point 2d Class A point is basically two coordinates, x and y, which are “real” numbers. This suggests that we might define a Java class to represent a point. The main task that objects of the Point2d class must accomplish is to store the x and y coordinates of the point.

The Basic 2d data structure – Point 2d Class

The Basic 2d data structure – Line2d Class Lines are the basic item of drawings. Each line has two end points. This suggests that an appropriate way to describe the drawings would be in terms of two classes: Line2d and Point2d. Thus to represent L1 in this scheme, we need 3 objects:

The Basic 2d data structure – Line2d Class The square has the corners, we are going to refer to the corners as nodes and they have special significance for the data structure. Notice in the drawing that a line is defined between two nodes (for example line L1 connects nodes N1 and N2) but not all nodes are connected by lines (for example N1 is not connected to N3).

The Basic 2d data structure – Line2d Class The square has the corners, we are going to refer to the corners as nodes and they have special significance for the data structure. Notice in the drawing that a line is defined between two nodes (for example line L1 connects nodes N1 and N2) but not all nodes are connected by lines (for example N1 is not connected to N3).

The Basic 2d data structure – Line2d Class

How come there are 4 nodes on this square, but you have 8 Point2d objects - surely your duplicating data unnecessarily. Well, yes and no. You can do it using 4 points and save your self 4 objects, but that means that those lines share instances of the points and CAN NEVER BE CHANGED INDEPENDANTLY. From a data modeling point of view, the corners of the square are in fact two points that JUST HAPPEN to be in the same place.

The Basic 2d data structure – Line2d Class

The Basic 2d data structure – Shape2d Class Any shape can be described as a collection of lines. Shape2d, is a class which maintains a list of all of the lines that make up a shape. This could be implemented in many ways, in fact we shall use a Vector which we will call lines. it is useful to know how many lines make up our shape. We use and integer named numberOfLines to keep count.

The Basic 2d data structure – Shape2d

The Basic 2d data structure – Drawing2d Class A drawing can consist of many shapes - We can therefore add a final class to our data model: Drawing2d, which can maintain another list (Vector) of the various shapes.

The Basic 2d data structure – Drawing2d Class

The Basic 2d data structure – Summary So, in full, we have a drawing object, which has a list of shape objects, which have lists of line objects, which have two point objects each.

The Basic 2d data structure – Class Diagram Drawing2d has Many Shapes Shape2d has many Lines Line2d has tow points

A working Gcanvas

The Completed system The final class diagram of the system should look something like this.

Exercises Describe the following data structures: Point Line Shape Drawing Describe the complete system and the class diagram for the following drawing.

Exercises