Podcast
Questions and Answers
Which statement accurately describes JavaScript arrays?
Which statement accurately describes JavaScript arrays?
- JavaScript arrays require explicit type declaration.
- JavaScript arrays are objects and can have dynamic sizes. (correct)
- JavaScript arrays do not inherit methods.
- JavaScript arrays are fixed in size like C arrays.
Which type of image uses gray levels and is analogous to black and white film?
Which type of image uses gray levels and is analogous to black and white film?
- Monochromatic Image
- Color Image
- Three-Color Theory Image
- Luminance Image (correct)
What is the key difference between the operators '==' and '===' in JavaScript?
What is the key difference between the operators '==' and '===' in JavaScript?
- '==' compares reference, whereas '===' compares values.
- '==' is used for comparison, and '===' for assignment.
- '==' checks value and type equality, while '===' checks value only.
- '==' checks for value equality, while '===' checks for strict equality including type. (correct)
What are the primary colors used in the additive color model?
What are the primary colors used in the additive color model?
Why might developers prefer standard JavaScript arrays over typed arrays?
Why might developers prefer standard JavaScript arrays over typed arrays?
What is the role of rods in the human visual system?
What is the role of rods in the human visual system?
Which of the following is a characteristic of JavaScript's typing system?
Which of the following is a characteristic of JavaScript's typing system?
What is the preferred approach to coding with graphics in JavaScript as suggested?
What is the preferred approach to coding with graphics in JavaScript as suggested?
In which context is subtractive color primarily used?
In which context is subtractive color primarily used?
What is the purpose of the three types of cones in the human eye?
What is the purpose of the three types of cones in the human eye?
Which equation is used for the projection of a point in a pinhole camera model?
Which equation is used for the projection of a point in a pinhole camera model?
What coding language is primarily used for WebGL development?
What coding language is primarily used for WebGL development?
Which statement is true about the three-color theory?
Which statement is true about the three-color theory?
What is the purpose of gl.clearColor function in the WebGL configuration?
What is the purpose of gl.clearColor function in the WebGL configuration?
Which method initializes the shader program for WebGL?
Which method initializes the shader program for WebGL?
What does the gl.drawArrays function do?
What does the gl.drawArrays function do?
What will happen if the WebGL context cannot be created during setup?
What will happen if the WebGL context cannot be created during setup?
Which data type is used for the position attribute in WebGL?
Which data type is used for the position attribute in WebGL?
When editing the HTML and JS files, what is specifically requested in the exercise?
When editing the HTML and JS files, what is specifically requested in the exercise?
What is a primary characteristic of JavaScript as mentioned in the notes?
What is a primary characteristic of JavaScript as mentioned in the notes?
What kind of triangle is rendered by the provided WebGL code?
What kind of triangle is rendered by the provided WebGL code?
What aspect does computer graphics focus on?
What aspect does computer graphics focus on?
Which software is mentioned as being built on top of OpenGL?
Which software is mentioned as being built on top of OpenGL?
What was the primary output device used in early computer graphics?
What was the primary output device used in early computer graphics?
What development in computer graphics occurred between the years 1960-1970?
What development in computer graphics occurred between the years 1960-1970?
Who recognized the potential of man-machine interaction in computer graphics?
Who recognized the potential of man-machine interaction in computer graphics?
What does the term 'Raster Graphics' refer to?
What does the term 'Raster Graphics' refer to?
Which development in computer graphics was emphasized during the 1980-1990 decade?
Which development in computer graphics was emphasized during the 1980-1990 decade?
What was significant about the OpenGL API introduced in the 1990-2000 period?
What was significant about the OpenGL API introduced in the 1990-2000 period?
What advancement in technology contributed to the growth of photorealism in computer graphics between 2000-2010?
What advancement in technology contributed to the growth of photorealism in computer graphics between 2000-2010?
What is a defining characteristic of the graphics environment from 2011 onwards?
What is a defining characteristic of the graphics environment from 2011 onwards?
What are the key components for forming an image in computer graphics?
What are the key components for forming an image in computer graphics?
Which aspect of light is emphasized in relation to the visual system?
Which aspect of light is emphasized in relation to the visual system?
What technique in image formation involves following rays from a point source?
What technique in image formation involves following rays from a point source?
What was a characteristic of computers during the early days of computer graphics?
What was a characteristic of computers during the early days of computer graphics?
Flashcards
What are the attributes of a color image?
What are the attributes of a color image?
Color images are comprised of hue, saturation, and lightness. They are created by simulating the human eye's response to color.
What are the primary colors in additive color models?
What are the primary colors in additive color models?
The three primary colors of light are red, green, and blue. Combining these in different proportions creates a vast range of colors.
What are the primary colors in subtractive color models?
What are the primary colors in subtractive color models?
The three primary colors of pigments or inks are cyan, magenta, and yellow. These colors subtract specific wavelengths of light, creating different shades.
How does a pinhole camera work?
How does a pinhole camera work?
Signup and view all the flashcards
What is WebGL?
What is WebGL?
Signup and view all the flashcards
What is the purpose of the vPosition
attribute in WebGL shaders?
What is the purpose of the vPosition
attribute in WebGL shaders?
Signup and view all the flashcards
What is the purpose of the gl_Position
variable in WebGL shaders?
What is the purpose of the gl_Position
variable in WebGL shaders?
Signup and view all the flashcards
What is the purpose of the gl_FragColor
variable in WebGL shaders?
What is the purpose of the gl_FragColor
variable in WebGL shaders?
Signup and view all the flashcards
JS Data Types
JS Data Types
Signup and view all the flashcards
JS Number Type
JS Number Type
Signup and view all the flashcards
JS Arrays as Objects
JS Arrays as Objects
Signup and view all the flashcards
Typed Arrays
Typed Arrays
Signup and view all the flashcards
Minimalist Approach
Minimalist Approach
Signup and view all the flashcards
What is Computer Graphics?
What is Computer Graphics?
Signup and view all the flashcards
Cathode Ray Tube (CRT)
Cathode Ray Tube (CRT)
Signup and view all the flashcards
Display Processor
Display Processor
Signup and view all the flashcards
Wireframe Graphics
Wireframe Graphics
Signup and view all the flashcards
Raster Graphics
Raster Graphics
Signup and view all the flashcards
GKS (Graphical Kernel System)
GKS (Graphical Kernel System)
Signup and view all the flashcards
Core (Computer Graphics Standards)
Core (Computer Graphics Standards)
Signup and view all the flashcards
OpenGL API
OpenGL API
Signup and view all the flashcards
Ray Tracing
Ray Tracing
Signup and view all the flashcards
Geometric Optics
Geometric Optics
Signup and view all the flashcards
Elements of Image Formation
Elements of Image Formation
Signup and view all the flashcards
Light
Light
Signup and view all the flashcards
Ray Tracing and Geometric Optics
Ray Tracing and Geometric Optics
Signup and view all the flashcards
Photorealism
Photorealism
Signup and view all the flashcards
Augmented Reality (AR)
Augmented Reality (AR)
Signup and view all the flashcards
JavaScript
JavaScript
Signup and view all the flashcards
window.onload
window.onload
Signup and view all the flashcards
HTML5 canvas
HTML5 canvas
Signup and view all the flashcards
render()
render()
Signup and view all the flashcards
WebGLUtils.setupWebGL
WebGLUtils.setupWebGL
Signup and view all the flashcards
gl.viewport
gl.viewport
Signup and view all the flashcards
gl.clear
gl.clear
Signup and view all the flashcards
gl.drawArrays(gl.TRIANGLES, 0, 3)
gl.drawArrays(gl.TRIANGLES, 0, 3)
Signup and view all the flashcards
Study Notes
Course Information
- Course title: Computer Graphics & Visualization
- Course code: CSE-423
- Lecturer: Dr. Reda Elbasiony
- Semester: Fall, 2024
- University: EGYPT-JAPAN UNIVERSITY OF SCIENCE AND TECHNOLOGY (E-JUST)
- Website: www.ejust.edu.eg
What is Computer Graphics?
- Computer graphics involves all aspects of creating images with a computer, including hardware, software, and applications.
- Computer graphics deals with producing images using a computer.
Preliminary Answer
- Application: The image is an artistic representation of the sun for a planetarium animation.
- Software: Maya, built on OpenGL, is used for modeling and rendering.
- Hardware: A PC with a graphics card was used for modeling and rendering.
Basic Graphics System
- Input devices send data to the processor (CPU).
- The CPU sends data to the graphics processor (GPU).
- The GPU processes the data and displays it on the output device.
- The frame buffer stores and displays the image.
- The CPU handles input and processing tasks.
- The GPU handles image display tasks.
Computer Graphics: 1950-1960
- The earliest computer graphics involved strip charts and pen plotters.
- Simple displays used A/D converters to display images on CRTs.
- Cost of CRT refresh was high, and computers were slow, expensive, and unreliable.
Cathode Ray Tube (CRT)
- CRTs used an electron gun and a phosphor-coated screen.
- The electron gun emits electrons that strike the phosphor.
- Focusing mechanisms ensure the electron beam strikes the correct part of the phosphor to create the desired image.
Shadow Mask CRT
- Shadow mask CRTs use a shadow mask to precisely direct the electron beams from separate color guns to the appropriate areas of the phosphor dots on the screen.
- This produces images with color.
Computer Graphics: 1960-1970
- Wireframe graphics involved displaying only lines, such as those in a sketchpad.
- Display processors were used for processing graphics.
- Storage tubes were used to store graphics.
- Wireframe representation, e.g., sun object.
Sketchpad
- Ivan Sutherland's PhD thesis at MIT showed the potential of man-machine interaction via a sketchpad.
- The sketchpad showed a new display system using a light pen.
- Computer graphics algorithms were invented by Sutherland.
Display Processor (DPU)
- A dedicated display processor takes over the task of refreshing the display.
- Graphics are stored in the display list.
- The host computer compiles the display list and sends it to the DPU.
Computer Graphics: 1970-1980
- Raster graphics were introduced, using graphic standards such as IFIPS and GKS.
- Raster graphics became a standard graphics method.
- Workstations and PCs improved graphics capabilities.
Raster Graphics
- Raster Graphics produces images as an array of pixels within a frame buffer.
- Raster graphics allows filling in polygons.
Computer Graphics: 1980-1990
- Realism in computer graphics is enhanced with smooth shading, environment mapping, and bump mapping.
Special Purpose Hardware
- Silicon Graphics geometry engine.
- VLSI implementation of graphics pipelines.
- PHIGS (Programmer's Hierarchical Interactive Graphics System) standard.
- RenderMan standard.
- Networked graphics, such as X Window System.
- Human-computer interfaces (HCI).
Computer Graphics: 1990-2000
- OpenGL API.
- Completely computer-generated feature-length movies.
- New hardware capabilities (texture mapping, blending, accumulation & stencil buffers).
Computer Graphics: 2000-2010
- Photorealism, with graphics cards dominating the PC market (Nvidia, ATI).
- Computer graphics routines for movie industries (Maya, Lightwave).
- Programmable pipelines.
- New display technologies.
Generic Flat Panel Display
- Light emitting elements are arranged in a grid pattern.
Computer Graphics 2011-
- Graphics became ubiquitous in cell phones and embedded systems.
- OpenGL ES and WebGL.
- Enhanced reality.
- 3D movies and TV.
Image Formation
- Images are two-dimensional representations of objects, viewers, and light sources.
- Methods for creating images are analogous to how physical imaging systems (cameras, microscopes, telescopes) create images.
- Formation of images involves capturing and displaying light from scenes.
Elements of Image Formation
- Objects: 3D representations of the scene elements.
- Viewer: 3D location and perspective of the image viewer.
- Light Sources: Light coming from sources in the scene to illuminate elements.
- Interactions: How light interacts with the scene materials (objects and surfaces).
- Independence of objects: Each object in the scene has separate characteristics that can be analyzed.
- Independence of Viewer: Various perspectives can be shown.
- Independence of light sources: Various light sources will produce different effects.
Light
- Light is part of the electromagnetic spectrum that reacts within visual systems.
- Light wavelengths are between 350-750 nanometers.
- Long wavelengths appear red while short wavelengths appear blue.
Ray Tracing and Geometric Optics
- Using trigonometry, computer graphics create images using rays of light following from a point to objects to a camera lens.
Luminance and Color Images
- Luminance images are monochromatic (gray levels).
- Analogous to black and white film or TV.
- Color images use hue, saturation, and lightness.
Three-Color Theory
- Human visual systems use two types of sensors: rods (monochrome, used for low light) and cones (color vision)
- Cones have three types for color vision sensitivity (red, green, and blue).
- Computer graphics only needs three primary colors to generate colors (red, green, and blue).
Additive and Subtractive Color
- Additive: Mixing primary colors (red, green, blue) to form compound colors. e.g. CRTs, projector systems
- Subtractive: Mixing light with filters of cyan, magenta, yellow. e.g. pigments, printing
Pinhole Camera
- Trigonometry determines the projection of a 3D point onto a 2D plane.
- Equations of simple perspective are used.
Coding in WebGL
- WebGL can run on recent browsers (Chrome, Firefox, Safari).
- Scripts are written in JavaScript to form display elements.
- JavaScript code runs within the browser and uses the local resources.
Example Code
- Code example of a triangle using vertex and fragment shaders.
HTML File
- Example HTML to set up canvas element and link JavaScript sources.
JS File
- Example JavaScript code using WebGL to draw a triangle.
JS File (cont)
- Further example of JS code for WebGL intial setup and display.
JS File (cont) 2
- Example code showing variables and functions to display data in the screen
Exercise
- Exercise: Run and edit provided files (triangle.html, triangle.js) to use WebGL to render.
JavaScript Notes
- JavaScript is the language for Web browsers.
- It is interpreted and object-oriented programming languages.
- Refer to online resources, including tutorials and books, for specific information.
JS Notes
- JavaScript engines in browsers are now fast enough to handle graphics data.
- JS is "too big" for simple use in cases where it isn't needed.
- Focus on graphic parts using JavaScript and avoid unnecessary structures.
JS Notes 2
- JS has limited data types.
- Number has a single 32-bit floating-point type.
- Be mindful of potential issues with loops.
JS Arrays
- JavaScript arrays are objects with methods, unlike C-style arrays.
Typed Arrays
- Typed arrays in JavaScript are similar to C arrays.
- Standard arrays are preferred to convert them into typed arrays.
A Minimalist Approach
- Only use core elements of JS and HTML when developing.
- Do not employ extra or varied packages unless absolutely needed.
- No additional packages like JQuery.
- Focus solely on core graphics functionality.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on JavaScript arrays, operators, and graphics coding. Additionally, explore concepts related to color theory and the human visual system. This quiz is perfect for those delving into programming and visual sciences.