ECM2410: Graphics and Animation - University of...

132
ECM2410: Graphics and Animation Dr. Peter Knaggs (Coordinator) H/271 Dr. Jovisa Zunic H/282

Transcript of ECM2410: Graphics and Animation - University of...

Page 1: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

ECM2410: Graphics and Animation

Dr. Peter Knaggs(Coordinator)

H/271

Dr. Jovisa ZunicH/282

Page 2: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

ECM2410: Graphics and Animation

Dr. Peter Knaggs(Coordinator)

H/271

Dr. Jovisa ZunicH/282

Page 3: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

ECM2410: Graphics and Animation

Dr. Peter Knaggs(Coordinator)

H/271

Dr. Jovisa ZunicH/282

Page 4: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 5: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 6: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 7: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 8: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 9: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 10: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 11: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Who and When

Lectures Lecture 1: Monday 3pm QUB/1GLecture 2: Tuesday 12-noon QUB/1G

Workshops Monday 1pm H/BlueMax Dupenois

Assessment CA 1 (15%) L02–06 TransformationsCA 2 (15%) L07–10 ClippingExamination (70%)

Administration Introduction 2/23

Page 12: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 13: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 14: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 15: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 16: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 17: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 18: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 19: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 20: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 21: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 22: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 23: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 24: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Administration Introduction 3/23

Page 25: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Books

Hearn, Baker &Carithers

Computer Graphics(Prentice Hall)

2010

Knudsen

Java 2D Graphics(O’Reilly)

1999

Foley, van Dam,Feiner & Hughes

Computer Graphics:Principles and Practice(Addison-Wesley)

1997

Books Introduction 4/23

Page 26: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Books

Hearn, Baker &Carithers

Computer Graphics(Prentice Hall)

2010

Knudsen

Java 2D Graphics(O’Reilly)

1999

Foley, van Dam,Feiner & Hughes

Computer Graphics:Principles and Practice(Addison-Wesley)

1997

Books Introduction 4/23

Page 27: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Books

Hearn, Baker &Carithers

Computer Graphics(Prentice Hall)

2010

Knudsen

Java 2D Graphics(O’Reilly)

1999

Foley, van Dam,Feiner & Hughes

Computer Graphics:Principles and Practice(Addison-Wesley)

1997

Books Introduction 4/23

Page 28: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Books

Hearn, Baker &Carithers

Computer Graphics(Prentice Hall)

2010

Knudsen

Java 2D Graphics(O’Reilly)

1999

Foley, van Dam,Feiner & Hughes

Computer Graphics:Principles and Practice(Addison-Wesley)

1997

Books Introduction 4/23

Page 29: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 30: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 31: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 32: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 33: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 34: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 35: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 36: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

More books

Computer Graphics with JavaGlenn Rowe, (Palgrave Macmillan), 2001

Computer Graphics Using Java 2D and 3DHong Zhang and Y. Daniel Liang, (Prentice Hall), 2007

3D Computer Graphics (3/e)Alan Watt, (Addison-Wesley), 2000

Computer Graphics, Mathematical First StepsPatricia Egerton and Bill Hall, (Prentice-Hall), 1998

Mathematics for Computer Graphics (3/e)John A. Vince, (Springer), 2010

Mathematical and Computer Programming Techniques for ComputerGraphicsPeter Comninos, (Springer), 2006

And many, many more, . . .Books Introduction 5/23

Page 37: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

Display of computer output information in pictorialform (as opposed to textual)either

on a visual display unitor printeror plotter

Chandor, Dictionary of computers

Computer graphics is concerned with all aspects ofproducing pictures or images using a computer

Angel, Interactive computer graphics

Computer Graphics Introduction 6/23

Page 38: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

Display of computer output information in pictorialform (as opposed to textual)either

on a visual display unitor printeror plotter

Chandor, Dictionary of computers

Computer graphics is concerned with all aspects ofproducing pictures or images using a computer

Angel, Interactive computer graphics

Computer Graphics Introduction 6/23

Page 39: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

Display of computer output information in pictorialform (as opposed to textual)either

on a visual display unitor printeror plotter

Chandor, Dictionary of computers

Computer graphics is concerned with all aspects ofproducing pictures or images using a computer

Angel, Interactive computer graphics

Computer Graphics Introduction 6/23

Page 40: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

Display of computer output information in pictorialform (as opposed to textual)either

on a visual display unitor printeror plotter

Chandor, Dictionary of computers

Computer graphics is concerned with all aspects ofproducing pictures or images using a computer

Angel, Interactive computer graphics

Computer Graphics Introduction 6/23

Page 41: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

Display of computer output information in pictorialform (as opposed to textual)either

on a visual display unitor printeror plotter

Chandor, Dictionary of computers

Computer graphics is concerned with all aspects ofproducing pictures or images using a computer

Angel, Interactive computer graphics

Computer Graphics Introduction 6/23

Page 42: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

Display of computer output information in pictorialform (as opposed to textual)either

on a visual display unitor printeror plotter

Chandor, Dictionary of computers

Computer graphics is concerned with all aspects ofproducing pictures or images using a computer

Angel, Interactive computer graphics

Computer Graphics Introduction 6/23

Page 43: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Examples: Films

Computer Graphics Introduction 7/23

Page 44: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Examples: Graphs and charts

1 2 3 4 5 6 7 8 9 100

0.2

0.4

0.6

0.8

1

K

P(M

K|X

)

(a)

0.04 0.06 0.08 0.1 0.12−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

x1

x 2

(b)

Computer Graphics Introduction 8/23

Page 45: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Examples: Scientific visualisation

Computer Graphics Introduction 9/23

Page 46: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Examples: Plans, circuit diagrams

Computer Graphics Introduction 10/23

Page 47: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Examples: Maps

Computer Graphics Introduction 11/23

Page 48: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 49: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 50: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 51: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 52: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 53: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 54: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 55: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 56: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 57: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Graphics Components

Shape of componentLines, boundariesAreas, regionsSymbols, markers, outlinesText

Appearance of componentColourSizeStyle

Computer Graphics Introduction 12/23

Page 58: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 59: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 60: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 61: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 62: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 63: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 64: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 65: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 66: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 67: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 68: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Computer Graphics

We will not coverPainting and imaging packages (eg Photoshop)CAD packages (AutoCAD)Modelling packages (3D Studio Max, Blender)Rendering packages (Renderman)Graphics APIs (OpenGL)

We will look atGraphics program constructionGraphics programming algorithmsGraphics data structuresGeometry and representing graphical objectsBasic Animation

This Module Introduction 13/23

Page 69: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 70: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 71: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 72: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 73: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 74: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 75: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 76: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Vector drawing – pen plotters

Pen is driven frompoint to point bysoftware instructionsProgramming isanalogous to manualdrawing:

moveTo(100, 100)penDown()lineTo(200, 200)lineTo(200, 100)

This Module Introduction 14/23

Page 77: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Raster displaysHardware

Display consists of arectangular array of pixels(picture elements) whoseintensity may be individuallyvaried.Framebuffer is an in-memorymap of the display; onememory location per pixel.Framebuffer may be addressedin any order (convenient), butis read-out to hardwaresequentially (efficient).

CoordinatesPictures/scenes specified in Cartesian coordinates (infiniteprecision), drawn on finite resolution displays.

RasterisationAlgorithms to convert infinite precision into pixels.

This Module Introduction 15/23

Page 78: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Raster displaysHardware

Display consists of arectangular array of pixels(picture elements) whoseintensity may be individuallyvaried.Framebuffer is an in-memorymap of the display; onememory location per pixel.Framebuffer may be addressedin any order (convenient), butis read-out to hardwaresequentially (efficient).

CoordinatesPictures/scenes specified in Cartesian coordinates (infiniteprecision), drawn on finite resolution displays.

RasterisationAlgorithms to convert infinite precision into pixels.

This Module Introduction 15/23

Page 79: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Raster displaysHardware

Display consists of arectangular array of pixels(picture elements) whoseintensity may be individuallyvaried.Framebuffer is an in-memorymap of the display; onememory location per pixel.Framebuffer may be addressedin any order (convenient), butis read-out to hardwaresequentially (efficient).

CoordinatesPictures/scenes specified in Cartesian coordinates (infiniteprecision), drawn on finite resolution displays.

RasterisationAlgorithms to convert infinite precision into pixels.

This Module Introduction 15/23

Page 80: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Raster displaysHardware

Display consists of arectangular array of pixels(picture elements) whoseintensity may be individuallyvaried.Framebuffer is an in-memorymap of the display; onememory location per pixel.Framebuffer may be addressedin any order (convenient), butis read-out to hardwaresequentially (efficient).

CoordinatesPictures/scenes specified in Cartesian coordinates (infiniteprecision), drawn on finite resolution displays.

RasterisationAlgorithms to convert infinite precision into pixels.

This Module Introduction 15/23

Page 81: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Raster displaysHardware

Display consists of arectangular array of pixels(picture elements) whoseintensity may be individuallyvaried.Framebuffer is an in-memorymap of the display; onememory location per pixel.Framebuffer may be addressedin any order (convenient), butis read-out to hardwaresequentially (efficient).

CoordinatesPictures/scenes specified in Cartesian coordinates (infiniteprecision), drawn on finite resolution displays.

RasterisationAlgorithms to convert infinite precision into pixels.

This Module Introduction 15/23

Page 82: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Raster displaysHardware

Display consists of arectangular array of pixels(picture elements) whoseintensity may be individuallyvaried.Framebuffer is an in-memorymap of the display; onememory location per pixel.Framebuffer may be addressedin any order (convenient), butis read-out to hardwaresequentially (efficient).

CoordinatesPictures/scenes specified in Cartesian coordinates (infiniteprecision), drawn on finite resolution displays.

RasterisationAlgorithms to convert infinite precision into pixels.

This Module Introduction 15/23

Page 83: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Raster displaysHardware

Display consists of arectangular array of pixels(picture elements) whoseintensity may be individuallyvaried.Framebuffer is an in-memorymap of the display; onememory location per pixel.Framebuffer may be addressedin any order (convenient), butis read-out to hardwaresequentially (efficient).

CoordinatesPictures/scenes specified in Cartesian coordinates (infiniteprecision), drawn on finite resolution displays.

RasterisationAlgorithms to convert infinite precision into pixels.

This Module Introduction 15/23

Page 84: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Coordinates and points

Cartesian coordinates

(3,2)

3

2

(0,0)

a

a =

(32

)

The Point class represents a 2-dimensional point or vector:a = new Point2D.Double(3.0, 2.0);double ax = a.getX(); // 3.0double ay = a.getY(); // 2.0

Coordinates, primitives & attributes Introduction 16/23

Page 85: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Coordinates and points

Cartesian coordinates

(3,2)

3

2

(0,0)

a a =

(32

)

The Point class represents a 2-dimensional point or vector:a = new Point2D.Double(3.0, 2.0);double ax = a.getX(); // 3.0double ay = a.getY(); // 2.0

Coordinates, primitives & attributes Introduction 16/23

Page 86: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Coordinates and points

Cartesian coordinates

(3,2)

3

2

(0,0)

a a =

(32

)

The Point class represents a 2-dimensional point or vector:a = new Point2D.Double(3.0, 2.0);double ax = a.getX(); // 3.0double ay = a.getY(); // 2.0

Coordinates, primitives & attributes Introduction 16/23

Page 87: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Coordinates and points

Cartesian coordinates

(3,2)

3

2

(0,0)

a a =

(32

)

The Point class represents a 2-dimensional point or vector:a = new Point2D.Double(3.0, 2.0);double ax = a.getX(); // 3.0double ay = a.getY(); // 2.0

Coordinates, primitives & attributes Introduction 16/23

Page 88: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Coordinates and points

Cartesian coordinates

(3,2)

3

2

(0,0)

a a =

(32

)

The Point class represents a 2-dimensional point or vector:a = new Point2D.Double(3.0, 2.0);double ax = a.getX(); // 3.0double ay = a.getY(); // 2.0

Coordinates, primitives & attributes Introduction 16/23

Page 89: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 90: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 91: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 92: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 93: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 94: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 95: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 96: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 97: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Geometrical primitives

Objects are built from primitives

Ideal mathematical objectsSpecified by location anddimensionThought of as having zero width– rendered with attributesSimple, usually reflectinghardware capabilitiesPoint, line, boundary, text

Point Line

Boundary

Text

Recent APIs regard complicated shapes (eg Bezier curves) asprimitivesKnudsen for details of Java primitives

Coordinates, primitives & attributes Introduction 17/23

Page 98: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Points

Primitive specification(x , y) coordinates of the point

Attributes

LinewidthColourSymbol

(x , y)

Coordinates, primitives & attributes Introduction 18/23

Page 99: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Points

Primitive specification(x , y) coordinates of the point

Attributes

LinewidthColourSymbol

(x , y)

Coordinates, primitives & attributes Introduction 18/23

Page 100: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Points

Primitive specification(x , y) coordinates of the point

Attributes

LinewidthColourSymbol

(x , y)

Coordinates, primitives & attributes Introduction 18/23

Page 101: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Points

Primitive specification(x , y) coordinates of the point

Attributes

LinewidthColourSymbol

(x , y)

Coordinates, primitives & attributes Introduction 18/23

Page 102: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Points

Primitive specification(x , y) coordinates of the point

Attributes

LinewidthColourSymbol

(x , y)

Coordinates, primitives & attributes Introduction 18/23

Page 103: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Points

Primitive specification(x , y) coordinates of the point

Attributes

LinewidthColourSymbol

(x , y)

Coordinates, primitives & attributes Introduction 18/23

Page 104: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Points

Primitive specification(x , y) coordinates of the point

Attributes

LinewidthColourSymbol

(x , y)

Coordinates, primitives & attributes Introduction 18/23

Page 105: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 106: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 107: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 108: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 109: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 110: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 111: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 112: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Line segments

Primitive specification(x1, y1) and (x2, y2) coordinatesof the end points

AttributesLinewidthLinestyle:dashed, dotted, solid, etcColour

(x1, y1)

(x2, y2)

Coordinates, primitives & attributes Introduction 19/23

Page 113: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 114: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 115: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 116: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 117: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 118: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 119: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 120: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 121: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 122: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 123: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 124: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Primitives: Boundaries

Rectangles and ellipses

Primitive specification(x , y) coordinates of bottomleft-hand cornerw , h width and height ofbounding box

AttributesLinewidth of boundaryLinestyle:dashed, dotted, solid, etcColour of boundaryColour of fillFill pattern

(x , y)

w

h

(x , y)

w

h

Coordinates, primitives & attributes Introduction 20/23

Page 125: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Java: Lines and Circles

public Line2D.Double(double X1, double Y1, double X2, double Y2)public Line2D.Double(Point2D p1, Point2D p2);

public Ellipse2D.Double(double x, double y, double w, double h)

// Draw a red line from (10,20) to (50,100)Graphics2D g2; // Graphics contextLine2D line = new Line2D.Double(10.0, 20.0, 50.0, 100.0);g2.setPaint(Color.red); // Set the colour attributeg2.setStroke(new BasicStroke(8)); // Line width 8 pixelsg2.draw(line); // Draw it

// Draw a green ellipse with a blue border from (100,100) and (50,50)Ellipse2D el = new Ellipse2D.Double(100.0, 100.0, 50.0, 50.0);g2.setPaint(Color.blue);g2.setStroke(new BasicStroke(1)); // A very thin border (1 pixel)g2.draw(el); // Draw boundaryg2.setPaint(Color.green)g2.fill(el); // Fill interior

Java Introduction 21/23

Page 126: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Java: Lines and Circles

public Line2D.Double(double X1, double Y1, double X2, double Y2)public Line2D.Double(Point2D p1, Point2D p2);

public Ellipse2D.Double(double x, double y, double w, double h)

// Draw a red line from (10,20) to (50,100)Graphics2D g2; // Graphics contextLine2D line = new Line2D.Double(10.0, 20.0, 50.0, 100.0);g2.setPaint(Color.red); // Set the colour attributeg2.setStroke(new BasicStroke(8)); // Line width 8 pixelsg2.draw(line); // Draw it

// Draw a green ellipse with a blue border from (100,100) and (50,50)Ellipse2D el = new Ellipse2D.Double(100.0, 100.0, 50.0, 50.0);g2.setPaint(Color.blue);g2.setStroke(new BasicStroke(1)); // A very thin border (1 pixel)g2.draw(el); // Draw boundaryg2.setPaint(Color.green)g2.fill(el); // Fill interior

Java Introduction 21/23

Page 127: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Java: Lines and Circles

public Line2D.Double(double X1, double Y1, double X2, double Y2)public Line2D.Double(Point2D p1, Point2D p2);

public Ellipse2D.Double(double x, double y, double w, double h)

// Draw a red line from (10,20) to (50,100)Graphics2D g2; // Graphics contextLine2D line = new Line2D.Double(10.0, 20.0, 50.0, 100.0);g2.setPaint(Color.red); // Set the colour attributeg2.setStroke(new BasicStroke(8)); // Line width 8 pixelsg2.draw(line); // Draw it

// Draw a green ellipse with a blue border from (100,100) and (50,50)Ellipse2D el = new Ellipse2D.Double(100.0, 100.0, 50.0, 50.0);g2.setPaint(Color.blue);g2.setStroke(new BasicStroke(1)); // A very thin border (1 pixel)g2.draw(el); // Draw boundaryg2.setPaint(Color.green)g2.fill(el); // Fill interior

Java Introduction 21/23

Page 128: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Java: Lines and Circles

public Line2D.Double(double X1, double Y1, double X2, double Y2)public Line2D.Double(Point2D p1, Point2D p2);

public Ellipse2D.Double(double x, double y, double w, double h)

// Draw a red line from (10,20) to (50,100)Graphics2D g2; // Graphics contextLine2D line = new Line2D.Double(10.0, 20.0, 50.0, 100.0);g2.setPaint(Color.red); // Set the colour attributeg2.setStroke(new BasicStroke(8)); // Line width 8 pixelsg2.draw(line); // Draw it

// Draw a green ellipse with a blue border from (100,100) and (50,50)Ellipse2D el = new Ellipse2D.Double(100.0, 100.0, 50.0, 50.0);g2.setPaint(Color.blue);g2.setStroke(new BasicStroke(1)); // A very thin border (1 pixel)g2.draw(el); // Draw boundaryg2.setPaint(Color.green)g2.fill(el); // Fill interior

Java Introduction 21/23

Page 129: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Java: Lines and Circles

public Line2D.Double(double X1, double Y1, double X2, double Y2)public Line2D.Double(Point2D p1, Point2D p2);

public Ellipse2D.Double(double x, double y, double w, double h)

// Draw a red line from (10,20) to (50,100)Graphics2D g2; // Graphics contextLine2D line = new Line2D.Double(10.0, 20.0, 50.0, 100.0);g2.setPaint(Color.red); // Set the colour attributeg2.setStroke(new BasicStroke(8)); // Line width 8 pixelsg2.draw(line); // Draw it

// Draw a green ellipse with a blue border from (100,100) and (50,50)Ellipse2D el = new Ellipse2D.Double(100.0, 100.0, 50.0, 50.0);g2.setPaint(Color.blue);g2.setStroke(new BasicStroke(1)); // A very thin border (1 pixel)g2.draw(el); // Draw boundaryg2.setPaint(Color.green)g2.fill(el); // Fill interior

Java Introduction 21/23

Page 130: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

Java: Lines and Circles

public Line2D.Double(double X1, double Y1, double X2, double Y2)public Line2D.Double(Point2D p1, Point2D p2);

public Ellipse2D.Double(double x, double y, double w, double h)

// Draw a red line from (10,20) to (50,100)Graphics2D g2; // Graphics contextLine2D line = new Line2D.Double(10.0, 20.0, 50.0, 100.0);g2.setPaint(Color.red); // Set the colour attributeg2.setStroke(new BasicStroke(8)); // Line width 8 pixelsg2.draw(line); // Draw it

// Draw a green ellipse with a blue border from (100,100) and (50,50)Ellipse2D el = new Ellipse2D.Double(100.0, 100.0, 50.0, 50.0);g2.setPaint(Color.blue);g2.setStroke(new BasicStroke(1)); // A very thin border (1 pixel)g2.draw(el); // Draw boundaryg2.setPaint(Color.green)g2.fill(el); // Fill interior

Java Introduction 21/23

Page 131: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

StringArt.java

Java Introduction 22/23

Page 132: ECM2410: Graphics and Animation - University of Exeterempslocal.ex.ac.uk/people/staff/pjk205/ECM2410/slides01.pdf · More books Computer Graphics with Java Glenn Rowe, (Palgrave Macmillan),

What and when

Lecture 1 Lecture 2

L01 Introduction Primitives & Modelling PKL02 Java 2D Transformations PKL03 Transformations Modelling and Java PKL04 Parametric Representations JZL05 Image Transforms Colour JZL06L07 Clipping Clipping PKL08 Rasterisation Rasterisation PKL09 Surface Modelling 3D Coordinate Systems JZL10 3D Rendering 3D Rendering JZL11 Animation Animation JZ

Lecture 1: Monday, 13am, QUB/1GLecture 2: Tuesday, 12-Noon, QUB/1G

Workshop: Monday, 1pm, HAR/Blue

Java Introduction 23/23