SlideShare a Scribd company logo
1 of 18
Bridgekloud
Graphics Fundamentals
Lesson 2
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
FundamentalsOutline
 Historical perspective
 Model of a Computer - Memory & Graphics
 Devices
 Raster Model & Bitmaps
 Coordinates
 Drawing Spaces
 Colors
 Graphics Libraries
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
BriefHistory
 Teletypes(pre 1950s), DisplayTubes(postWW2),
CRTs(last half of 20th century), Flat Panels
(modern era)
 Size and Quality (eg resolution) driven by
economics (eg 640x320…1024x768…)
 Vector (circaWW2) & Raster/Bitmap models
 Devices & Human / Machine Interaction
 Memory and Processing Speed limitations
ComputerMemoryModel
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
 Main Memory
 Graphics memory
 Used to be limited to separate amount on eg graphics
card
 Modern idea is to partition main memory dynamically
(ie by software instruction)
 Modern idea is to map memory to the display
 Independent of display hardware type
ComputerMemoryModel cont…..
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
 CPU + Cache memory + Main memory
 Cache memory is fast but expensive so (still
often) only have small amount eg 512kBytes
available
 Main memory relatively plentiful (eg GBytes)
but slow
Memory&Graphics
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
Idea is that we can write programs that interact with
the graphical display device simply by writing to a
predetermined area of the computer’s memory
 Known as Bitmap graphics
 The bits are mapped to the pixels
 Flexible, portable software
 Independent of Hardware & Operating System
GraphicalDevices
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
Devices eg mouse, stereo glasses, tracker ball, light pen, touch
screen, 3d-wand, “rat”, sensor gloves, head tracker, iris tracker,…
Even Mouse varies in form factor and number of buttons
 Main Memory
 Graphics memory
 Used to be limited to separate amount on eg graphics
card
 Modern idea is to partition main memory dynamically (ie
by software instruction)
 Modern idea is to map memory to the display
 Independent of display hardware type
GraphicalDevices
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
 Mouse - most well known device
 Buttons, and scan movements
 Jargon ideas that have become common:
 Drag
 Click
 Double-Click
 Left -Click
 Main idea is to let you specify a location in a space eg x,y (or
x,y,z) coordinates
RasterModel-Pixels
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
Pixel or sometimes “pel” Picture Element
Each pixel is a sample that can be rendered as a dot or
rectangle on the screen
Often try to design them as squares but not always
 Might be implemented as small area of
phosphor on a monochrome monitor
 Or three areas of eg red, green and blue
phosphors for colour
 Or simple a transistor logic gate assembly on
a flat panel display
CoordinateSystems
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
 Pixel Coordinate System - rows and columns
 Rectilinear
 Usually for graphics, we start at top left corner and work our
way across and down
 Same as raster orientation
 Array[row][column]
 Row major used in C and C+ ( last index moves
fastest in memory)
 Not all languages do it this way - eg Fortran
uses column major (first index moves fastest)
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
CartesianCoordinates
Often we use the Cartesian
coordinate convention ie x,y
coordinates (or x,y,z in 3D) and
map this to our display
Usually column corresponds to x,
and -row corresponds to y
 This works if we know the
max min values.
 Common values are eg
640 columns x 320 rows
 Or 1024x768 or better
 Aspect ratio is the ratio of
these eg 4:3 - Chosen to
suit the common display
devices egTV screens or
monitors
x
y
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
DrawingSpaceorCanvas
Coordinate Systems
Drawing Primitives
Library of utilities
 eg drawDot( int x, int y);
 Or drawLine( x1, y1, x2, y2 );
Usually we have “Primitive”
Models for coordinate spaces and
colours
 We do not want to write
our application programs
worrying about pixel
resolutions
 We may have libraries
that allow us to do so,
but often they will
support more general
coordinates
 Eg real space
“normalised”
coordinates [0.0,1.0]
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
ColoursinBrief
Red Green Blue is not the Only
colour model although still most
common
We specify separate RGB
values for each pixel
They map to intensities
All colours can be expressed as
combination of these
Sometimes also an “alpha” or
transparency value
 These will conveniently pack
into a computer word of 4
bytes, one byte for each
entity
 1 Byte gives us 256 values -
hence numbers of colours
 Need not use this
resolution
 Can also use Look-up tables
to save memory
GraphicsLibrariesandpackages
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
What is a graphics system?
A package or Library that links to a Language or
environment and lets us write programs that are
independent of the graphics
Java Development Kit and Java 2D and Java 3D
libraries
GL and OpenGL (Graphics Library),VOGL
X11, DirectX, PHIGS,… and lots of others
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
JavaGraphicsProgramOutline
 A short example- MyProg01 draws a black
rectangle inside a white rectangle
 See the course web pages for these codes
 Use a text editor or your favourite text tool
(eg emacs or vi or notepad) to create
MyProg01.java
 Compile it using javac MyProg01.java
 Run using java Myprog01
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
Java GraphicsCodeFragment
// g2 is the Graphics2D object supplied by the system…
g2.setBackground( Color.white ); // set background colour
g2.clearRect( 0, 0, getWidth(), getHeight() ); // clear an area
g2.setColor( Color.black ); // set the drawing colour
g2.fillRect( 10, 10, 20, 20 ); // fill in a rectangle of that colour
g2.drawRect( 0, 0, getWidth()-1, getHeight()-1 ); // draw a border around everything
 More on how this works next lecture and at the
tutorials…
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
WhatMyProg01OutputLooksLike
Black rectangle inside a white area…
Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
Summary
Graphics has a varied history
Very technology driven
Good advances in recent years with
adequate memory and processing
power
Primitives and library layers approach
is very common
 Note devices and
memory model
 Colour models and
drawing spaces are
important ideas for our
programs
 We will use the Java
Development Kit
graphics libraries and
primitives

More Related Content

What's hot

Computer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - IntroductionComputer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - Introduction💻 Anton Gerdelan
 
Computer graphics.
Computer graphics.Computer graphics.
Computer graphics.ALIHAMID71
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsAdri Jovin
 
Lecture applications of cg
Lecture   applications of cgLecture   applications of cg
Lecture applications of cgavelraj
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsAnkur Soni
 
Computer graphics - Nitish Nagar
Computer graphics - Nitish NagarComputer graphics - Nitish Nagar
Computer graphics - Nitish NagarNitish Nagar
 
line drawing algorithms COMPUTER GRAPHICS & Graphical Programming
 line drawing algorithms COMPUTER GRAPHICS  & Graphical  Programming  line drawing algorithms COMPUTER GRAPHICS  & Graphical  Programming
line drawing algorithms COMPUTER GRAPHICS & Graphical Programming bridgekloud
 
3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer GraphicsFaraz Akhtar
 
Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Iftikhar Ahmad
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsMichael Heron
 
Application of computer graphics and input devices
Application of computer graphics and input devicesApplication of computer graphics and input devices
Application of computer graphics and input devicesMani Kanth
 
Overview of graphics systems
Overview of  graphics systemsOverview of  graphics systems
Overview of graphics systemsJay Nagar
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsAmandeep Kaur
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsPartnered Health
 

What's hot (20)

Computer graphics, group 9, bba a
Computer graphics, group 9, bba aComputer graphics, group 9, bba a
Computer graphics, group 9, bba a
 
Overview of Computer Graphics
Overview of Computer GraphicsOverview of Computer Graphics
Overview of Computer Graphics
 
Computer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - IntroductionComputer Graphics - Lecture 00 - Introduction
Computer Graphics - Lecture 00 - Introduction
 
Computer graphics.
Computer graphics.Computer graphics.
Computer graphics.
 
fundamentals of Computer graphics(Computer graphics tutorials)
 fundamentals of Computer graphics(Computer graphics tutorials) fundamentals of Computer graphics(Computer graphics tutorials)
fundamentals of Computer graphics(Computer graphics tutorials)
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Lecture applications of cg
Lecture   applications of cgLecture   applications of cg
Lecture applications of cg
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Computer graphics - Nitish Nagar
Computer graphics - Nitish NagarComputer graphics - Nitish Nagar
Computer graphics - Nitish Nagar
 
line drawing algorithms COMPUTER GRAPHICS & Graphical Programming
 line drawing algorithms COMPUTER GRAPHICS  & Graphical  Programming  line drawing algorithms COMPUTER GRAPHICS  & Graphical  Programming
line drawing algorithms COMPUTER GRAPHICS & Graphical Programming
 
3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics
 
Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D Graphics
 
Application of computer graphics and input devices
Application of computer graphics and input devicesApplication of computer graphics and input devices
Application of computer graphics and input devices
 
Lcd bresenham
Lcd bresenhamLcd bresenham
Lcd bresenham
 
K10765 Matlab 3D Mesh Plots
K10765 Matlab 3D Mesh PlotsK10765 Matlab 3D Mesh Plots
K10765 Matlab 3D Mesh Plots
 
Overview of graphics systems
Overview of  graphics systemsOverview of  graphics systems
Overview of graphics systems
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 

Similar to Ics2311 l02 Graphics fundamentals

An Introduction to Computer Science with Java .docx
An Introduction to  Computer Science with Java .docxAn Introduction to  Computer Science with Java .docx
An Introduction to Computer Science with Java .docxdaniahendric
 
Ics2311 l01 display technologies & interactive devices
Ics2311 l01 display technologies & interactive devicesIcs2311 l01 display technologies & interactive devices
Ics2311 l01 display technologies & interactive devicesbridgekloud
 
Computer Graphics Power Point using Open GL and C Programming
Computer Graphics Power Point using Open GL and C ProgrammingComputer Graphics Power Point using Open GL and C Programming
Computer Graphics Power Point using Open GL and C Programmingkemal678348
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalMasatsugu HASHIMOTO
 
Screensaver presentation
Screensaver presentationScreensaver presentation
Screensaver presentationMatt Dickson
 
Screensaver presentation
Screensaver presentationScreensaver presentation
Screensaver presentationMatt Dickson
 
Midterm revision 2022 without answer.pdf
Midterm revision 2022  without answer.pdfMidterm revision 2022  without answer.pdf
Midterm revision 2022 without answer.pdfAhmedSalah48055
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Lviv Startup Club
 
unit1_updated.pptx
unit1_updated.pptxunit1_updated.pptx
unit1_updated.pptxRYZEN14
 
Computer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGLComputer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGLSharath Raj
 
Digital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media FactoryDigital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media FactoryMassimo Menichinelli
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentDavid Galeano
 
Cadence design environment
Cadence design environmentCadence design environment
Cadence design environmentHoopeer Hoopeer
 
Minecraft in 500 lines of Python with Pyglet
Minecraft in 500 lines of Python with PygletMinecraft in 500 lines of Python with Pyglet
Minecraft in 500 lines of Python with PygletRichard Donkin
 

Similar to Ics2311 l02 Graphics fundamentals (20)

Mod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdfMod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdf
 
An Introduction to Computer Science with Java .docx
An Introduction to  Computer Science with Java .docxAn Introduction to  Computer Science with Java .docx
An Introduction to Computer Science with Java .docx
 
Task 2
Task 2Task 2
Task 2
 
Ics2311 l01 display technologies & interactive devices
Ics2311 l01 display technologies & interactive devicesIcs2311 l01 display technologies & interactive devices
Ics2311 l01 display technologies & interactive devices
 
Computer Graphics Power Point using Open GL and C Programming
Computer Graphics Power Point using Open GL and C ProgrammingComputer Graphics Power Point using Open GL and C Programming
Computer Graphics Power Point using Open GL and C Programming
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_Final
 
Screensaver presentation
Screensaver presentationScreensaver presentation
Screensaver presentation
 
Screensaver presentation
Screensaver presentationScreensaver presentation
Screensaver presentation
 
lecture 4
 lecture 4 lecture 4
lecture 4
 
Midterm revision 2022 without answer.pdf
Midterm revision 2022  without answer.pdfMidterm revision 2022  without answer.pdf
Midterm revision 2022 without answer.pdf
 
Graphics file
Graphics fileGraphics file
Graphics file
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
 
unit1_updated.pptx
unit1_updated.pptxunit1_updated.pptx
unit1_updated.pptx
 
Computer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGLComputer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGL
 
Digital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media FactoryDigital Fabrication Studio.03 _Software @ Aalto Media Factory
Digital Fabrication Studio.03 _Software @ Aalto Media Factory
 
cad_theory.ppt
cad_theory.pptcad_theory.ppt
cad_theory.ppt
 
AUTOCAD REPORT.pptx
AUTOCAD REPORT.pptxAUTOCAD REPORT.pptx
AUTOCAD REPORT.pptx
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
 
Cadence design environment
Cadence design environmentCadence design environment
Cadence design environment
 
Minecraft in 500 lines of Python with Pyglet
Minecraft in 500 lines of Python with PygletMinecraft in 500 lines of Python with Pyglet
Minecraft in 500 lines of Python with Pyglet
 

Recently uploaded

Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpmainac1
 
Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...
Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...
Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...narwatsonia7
 
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024CristobalHeraud
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130Suhani Kapoor
 
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一F dds
 
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Servicejennyeacort
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一Fi L
 
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
NATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailNATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailDesigntroIntroducing
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Douxkojalkojal131
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Nightssuser7cb4ff
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证nhjeo1gg
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case StudySophia Viganò
 

Recently uploaded (20)

Call Girls in Pratap Nagar, 9953056974 Escort Service
Call Girls in Pratap Nagar,  9953056974 Escort ServiceCall Girls in Pratap Nagar,  9953056974 Escort Service
Call Girls in Pratap Nagar, 9953056974 Escort Service
 
Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUp
 
Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...
Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...
Housewife Call Girls NRI Layout - Call 7001305949 Rs-3500 with A/C Room Cash ...
 
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
 
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
 
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
办理学位证(SFU证书)西蒙菲莎大学毕业证成绩单原版一比一
 
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
 
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
 
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
 
NATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailNATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detail
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case Study
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 

Ics2311 l02 Graphics fundamentals

  • 1. Bridgekloud Graphics Fundamentals Lesson 2 Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311
  • 2. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 FundamentalsOutline  Historical perspective  Model of a Computer - Memory & Graphics  Devices  Raster Model & Bitmaps  Coordinates  Drawing Spaces  Colors  Graphics Libraries
  • 3. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 BriefHistory  Teletypes(pre 1950s), DisplayTubes(postWW2), CRTs(last half of 20th century), Flat Panels (modern era)  Size and Quality (eg resolution) driven by economics (eg 640x320…1024x768…)  Vector (circaWW2) & Raster/Bitmap models  Devices & Human / Machine Interaction  Memory and Processing Speed limitations
  • 4. ComputerMemoryModel Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311  Main Memory  Graphics memory  Used to be limited to separate amount on eg graphics card  Modern idea is to partition main memory dynamically (ie by software instruction)  Modern idea is to map memory to the display  Independent of display hardware type
  • 5. ComputerMemoryModel cont….. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311  CPU + Cache memory + Main memory  Cache memory is fast but expensive so (still often) only have small amount eg 512kBytes available  Main memory relatively plentiful (eg GBytes) but slow
  • 6. Memory&Graphics Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 Idea is that we can write programs that interact with the graphical display device simply by writing to a predetermined area of the computer’s memory  Known as Bitmap graphics  The bits are mapped to the pixels  Flexible, portable software  Independent of Hardware & Operating System
  • 7. GraphicalDevices Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 Devices eg mouse, stereo glasses, tracker ball, light pen, touch screen, 3d-wand, “rat”, sensor gloves, head tracker, iris tracker,… Even Mouse varies in form factor and number of buttons  Main Memory  Graphics memory  Used to be limited to separate amount on eg graphics card  Modern idea is to partition main memory dynamically (ie by software instruction)  Modern idea is to map memory to the display  Independent of display hardware type
  • 8. GraphicalDevices Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311  Mouse - most well known device  Buttons, and scan movements  Jargon ideas that have become common:  Drag  Click  Double-Click  Left -Click  Main idea is to let you specify a location in a space eg x,y (or x,y,z) coordinates
  • 9. RasterModel-Pixels Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 Pixel or sometimes “pel” Picture Element Each pixel is a sample that can be rendered as a dot or rectangle on the screen Often try to design them as squares but not always  Might be implemented as small area of phosphor on a monochrome monitor  Or three areas of eg red, green and blue phosphors for colour  Or simple a transistor logic gate assembly on a flat panel display
  • 10. CoordinateSystems Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311  Pixel Coordinate System - rows and columns  Rectilinear  Usually for graphics, we start at top left corner and work our way across and down  Same as raster orientation  Array[row][column]  Row major used in C and C+ ( last index moves fastest in memory)  Not all languages do it this way - eg Fortran uses column major (first index moves fastest)
  • 11. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 CartesianCoordinates Often we use the Cartesian coordinate convention ie x,y coordinates (or x,y,z in 3D) and map this to our display Usually column corresponds to x, and -row corresponds to y  This works if we know the max min values.  Common values are eg 640 columns x 320 rows  Or 1024x768 or better  Aspect ratio is the ratio of these eg 4:3 - Chosen to suit the common display devices egTV screens or monitors x y
  • 12. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 DrawingSpaceorCanvas Coordinate Systems Drawing Primitives Library of utilities  eg drawDot( int x, int y);  Or drawLine( x1, y1, x2, y2 ); Usually we have “Primitive” Models for coordinate spaces and colours  We do not want to write our application programs worrying about pixel resolutions  We may have libraries that allow us to do so, but often they will support more general coordinates  Eg real space “normalised” coordinates [0.0,1.0]
  • 13. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 ColoursinBrief Red Green Blue is not the Only colour model although still most common We specify separate RGB values for each pixel They map to intensities All colours can be expressed as combination of these Sometimes also an “alpha” or transparency value  These will conveniently pack into a computer word of 4 bytes, one byte for each entity  1 Byte gives us 256 values - hence numbers of colours  Need not use this resolution  Can also use Look-up tables to save memory
  • 14. GraphicsLibrariesandpackages Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 What is a graphics system? A package or Library that links to a Language or environment and lets us write programs that are independent of the graphics Java Development Kit and Java 2D and Java 3D libraries GL and OpenGL (Graphics Library),VOGL X11, DirectX, PHIGS,… and lots of others
  • 15. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 JavaGraphicsProgramOutline  A short example- MyProg01 draws a black rectangle inside a white rectangle  See the course web pages for these codes  Use a text editor or your favourite text tool (eg emacs or vi or notepad) to create MyProg01.java  Compile it using javac MyProg01.java  Run using java Myprog01
  • 16. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 Java GraphicsCodeFragment // g2 is the Graphics2D object supplied by the system… g2.setBackground( Color.white ); // set background colour g2.clearRect( 0, 0, getWidth(), getHeight() ); // clear an area g2.setColor( Color.black ); // set the drawing colour g2.fillRect( 10, 10, 20, 20 ); // fill in a rectangle of that colour g2.drawRect( 0, 0, getWidth()-1, getHeight()-1 ); // draw a border around everything  More on how this works next lecture and at the tutorials…
  • 17. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 WhatMyProg01OutputLooksLike Black rectangle inside a white area…
  • 18. Bridgekloud: https://www.bridgekloud.com Unit: Computer Graphics ICS2311 Summary Graphics has a varied history Very technology driven Good advances in recent years with adequate memory and processing power Primitives and library layers approach is very common  Note devices and memory model  Colour models and drawing spaces are important ideas for our programs  We will use the Java Development Kit graphics libraries and primitives