CG - Module - 3
CG - Module - 3
Prepared By :
Dr. Deepak N A
Associate Professor,
Department of Computer Science and Engineering
RVITM, Bengaluru – 560076
Email: [email protected]
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
- Module - 3
3.1.1 Logical Classification of Input Devices
1. Pointing Devices:
Mouse: A hand-held device used to control the movement of a cursor on a screen.
Trackpad/Touchpad: Commonly found on laptops, it allows users to move the cursor by
sliding their fingers across its surface.
Trackball: Operated by rotating a ball with the hand or fingers to move the cursor.
2. Keyboard Devices:
Standard Keyboard: A typewriter-style device with keys for entering letters, numbers, and
other characters.
Ergonomic Keyboard: Designed to reduce muscle strain and improve comfort during
extended typing sessions.
Virtual Keyboard: Software-based keyboards displayed on a touchscreen or projected onto
a surface.
3. Voice Input Devices:
Microphone: Captures audio input which is then processed by speech recognition software
to convert it into text or command inputs.
4. Touch Input Devices:
Touch screen: Displays visual output and allows users to interact by touching the screen
directly.
Stylus/Pen Input: A pen-like device used to write or draw directly onto a touchscreen or
graphics tablet.
5. Gesture Input Devices:
Motion Controllers: Devices that capture hand or body movements to control on-screen
actions, often used in gaming or virtual reality applications.
-----------------------------------------------------------------------------------------------------------------------------------------
- Manual Input: Users directly input data into a graphical tool or software interface. This can
involve typing data into a form, spreadsheet, or data entry software. Manual input is suitable
for small datasets or when data is generated infrequently.
File Import: Data is imported into a graphical tool from external files. These files can be in
various formats such as CSV (Comma Separated Values), Excel spreadsheets, JSON
(JavaScript Object Notation), XML (eXtensible Markup Language), or database files. File
import allows for quick and easy visualization of large datasets stored in structured formats.
Database Query: Data is retrieved from a database using SQL (Structured Query Language)
queries. This method is commonly used when dealing with large datasets stored in relational
databases. Database queries allow for efficient retrieval of specific data subsets based on
predefined criteria
API Integration: Data is fetched from external sources or services using Application
Programming Interfaces (APIs). This could include accessing data from web services, IoT
(Internet of Things) devices, social media platforms, or other online data sources. API
integration enables real-time or near-real-time data visualization and analysis.
Sensor Data Acquisition: In scenarios involving IoT or sensor networks, data is collected
from physical sensors deployed in the environment. This data could include temperature,
humidity, pressure, motion, or any other measurable quantity. Sensor data acquisition systems
typically involve hardware components for data collection and software interfaces for data
processing and visualization.
Web Scraping: Data is extracted from websites or online sources using web scraping
techniques. This method is useful for collecting data from websites that do not provide APIs or
structured data formats. Web scraping tools parse HTML or other markup languages to extract
relevant information for visualization.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 3 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-
3. 3D Modeling Software:
Polygon Modeling: Allows users to create and manipulate 3D models by interactively
editing individual polygons, vertices, and edges.
5. Animation Software:
Keyframe Animation: Users can interactively set keyframes to define the position, rotation,
and scale of objects over time.
Timeline Editor: Allows users to interactively adjust the timing and duration of animations
by manipulating key frames on a timeline.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 4 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-These techniques empower users to actively participate in the creation and exploration of digital
images, artworks, and visualizations, fostering creativity and engagement in various domains such as
graphic design, digital art, animation, and data visualization.
1. Head-Mounted Displays (HMDs): HMDs are worn on the head and typically consist of a
screen or screens that cover the user's field of view, creating a stereoscopic 3D effect. These
displays are often accompanied by headphones or audio systems to provide spatial audio.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 5 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
- 5. Immersive Content: VR environments can feature a wide range of immersive content,
including interactive experiences, games, simulations, educational applications, virtual tours,
artistic creations, and more. The content is designed to engage users and provide a compelling
virtual experience.
Overall, VR environments offer a unique and immersive way for users to explore virtual worlds,
interact with digital content, and experience new forms of entertainment, education, training, and
communication.
OpenGL, a widely used graphics library, doesn't directly handle input devices. Instead, it relies on
other libraries or frameworks for input handling. However, OpenGL does provide the necessary
functionalities for rendering graphics based on input data received from input devices. Here are some
common input-related functions and concepts used in conjunction with OpenGL:
1. Windowing Systems: OpenGL applications typically run within a windowing system (e.g.,
GLFW, SDL, or GLUT). These libraries provide functions for creating windows, handling
input events, and managing the OpenGL context.
2. Event Handling: Input events, such as keyboard presses, mouse movements, and button
clicks, are handled by the windowing system and passed to the OpenGL application.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 6 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-
3. Mouse Input: OpenGL applications can capture mouse input events, such as mouse
movement, button presses, and scrolling.
4. Keyboard Input: Keyboard input events, such as key presses and releases, can be captured
by OpenGL applications.
5. Gamepad/Input Device Support: OpenGL applications can support input devices such as
gamepads, joysticks, and other controllers.
OpenGL itself does not provide functions specifically for creating menus, as it is primarily a graphics
rendering library focused on rendering 2D and 3D graphics. However, menus can be implemented in
OpenGL applications using techniques such as rendering textured polygons as buttons, detecting
mouse clicks within specific regions of the window, and responding to those clicks appropriately.
1. Rendering Menu Items: Use OpenGL functions to draw textured polygons or simple
geometric shapes (such as rectangles) to represent menu items.
2. Positioning Menu Items: Determine the positions of menu items within the application
window. Use OpenGL transformations (translations, rotations, and scaling) to position and size
the menu items appropriately.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 7 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-
3. Detecting Mouse Clicks: Use a windowing library such as GLFW, SDL, or GLUT to
capture mouse click events. Convert mouse coordinates to OpenGL viewport coordinates and
check if they intersect with any of the menu items.
4. Responding to Clicks: When a mouse click is detected within a menu item's region, trigger
the corresponding action. This could involve opening a submenu, executing a command,
changing a setting, or any other functionality associated with the menu item.
Designing a graphical user interface (GUI) involves a blend of creativity, functionality, and usability.
Here's a structured approach to guide you through the process:
1. Define Purpose and Audience: Understand the purpose of the application and the needs of
its users. Define the primary goals the GUI should achieve and the target audience it will serve.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 8 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
- 3. Sketch Wireframes: Start by sketching rough wireframes to visualize the layout and
structure of the GUI. Focus on key elements such as navigation menus, buttons, forms, and
content areas.
4. Create Mockups and Prototypes: Use design tools like Figma, Adobe XD, or Sketch to
create high-fidelity mockups of the GUI. Design multiple iterations, exploring different visual
styles, color schemes, and typography choices.
1. Storyboarding: Start by sketching out your ideas in a storyboard format. This helps you
visualize the sequence and plan the flow of action.
2. Scripting: Write a script detailing the actions, dialogues, and scene descriptions. This will
serve as a guide for animators and voice actors (if applicable).
3. Character Design: Develop the appearance and personality of your characters. Consider
their movements, expressions, and mannerisms.
4. Key frames: Identify the key moments in the sequence and create keyframes to represent
them. These frames will serve as the foundation for the animation.
5. Timing and Pacing: Determine the timing and pacing of each action and scene transition.
This will impact the overall rhythm and feel of the animation.
6. Animating: Bring the keyframes to life by filling in the in-between frames. Pay attention to
details such as easing in and out of movements for a more natural look.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 9 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
- 7. Adding Effects: Incorporate visual effects, sound effects, and music to enhance the
atmosphere and convey emotions.
8. Review and Revision: Review the animation sequence and make any necessary revisions to
improve clarity, coherence, and visual appeal.
9. Rendering: Render the final animation in the desired format and resolution.
10. Testing: Test the animation on different devices and screen sizes to ensure compatibility
and optimal viewing experience.
11. Feedback: Gather feedback from colleagues or target audience members and make further
adjustments if needed.
12. Finalization: Once satisfied with the animation, finalize it for distribution or publication.
Traditional animation techniques refer to the methods used to create animation before the advent of
digital technology. Here are some of the key techniques:
1. Hand-Drawn Animation: This is perhaps the most classic form of animation. Each frame is
drawn by hand, typically on paper, and then photographed or scanned onto transparent
celluloid sheets called "cells." The cells are then layered on top of background artwork to
create the final animation sequence.
2. Cell Animation: Cell animation involves drawing characters and objects on transparent
celluloid sheets (cells) and placing them over a static background. This technique allows for
easy manipulation of characters while keeping the background consistent.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 10 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
- 4. Stop Motion Animation: In stop motion animation, physical objects or characters are
manipulated frame by frame and photographed to create the illusion of movement. Common
forms include claymation (using clay figures), puppet animation (using articulated puppets),
and object animation (using everyday objects).
5. Pencil Tests: Pencil tests are rough animations created to test the movement and timing of
characters or scenes before finalizing the artwork. They're typically done using simple line
drawings to quickly iterate and refine the animation.
Computer animation encompasses a wide range of techniques and functions used to create animated
content using digital tools. Here are some general functions commonly used in computer animation:
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 11 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-
2. Texturing: Texturing is the process of applying surface textures and colors to 3D models to
give them a realistic appearance. This can involve creating textures from scratch or using pre-
made texture libraries.
3. Rigging: Rigging involves adding a digital skeleton (rig) to a 3D model to enable movement
and animation. This skeleton consists of bones and joints that can be manipulated to pose the
model in different ways.
5. Rendering: Rendering is the process of generating the final images or frames from a 3D
scene. This involves applying lighting, shading, and camera effects to create the desired look.
Rendering can be CPU-based or GPU-based, and there are various rendering engines available
with different features and capabilities.
6. Simulation: Simulation involves creating realistic physical effects such as cloth simulation,
fluid simulation, and particle effects. These effects can add depth and realism to animated
scenes and are often used in visual effects and gaming.
7. Compositing: Compositing is the process of combining multiple layers of visual elements,
such as 3D renders, live-action footage, and special effects, into a single image or sequence.
This is typically done using compositing software and involves adjusting colors, adding visual
effects, and fine-tuning the final output.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 12 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
- 2. C++: C++ is a powerful programming language commonly used for developing animation
software and graphics engines. Many animation and visual effects applications, such as
Autodesk Maya, Pixar's RenderMan, and SideFX Houdini, are built using C++ for their core
functionality and performance-critical tasks.
4. GLSL (OpenGL Shading Language): GLSL is a high-level shading language used with
OpenGL and WebGL for writing shaders, which are small programs that run on the GPU to
control the rendering process. GLSL is used to create complex visual effects, shaders, and
materials in computer animation and real-time graphics applications.
6. Java Script: JavaScript is commonly used in web-based animation and interactive media
projects. Libraries and frameworks like Three.js and PIXI.js provide tools for creating 3D
graphics, animations, and interactive experiences using JavaScript and HTML5.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 13 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-3.2.5: Character Animation
Character animation involves bringing digital or physical characters to life through movement and
expression. Here's an overview of the process and techniques involved in character animation:
1. Character Design: Before animating a character, it's essential to have a well-defined design
that includes aspects like appearance, personality, and backstory. This design will influence
how the character moves and behaves.
2. Story boarding: Storyboarding helps plan out the sequence of actions and expressions for
the character. It provides a visual guide for animators to follow and ensures the animation
flows smoothly.
3. Modeling: In 3D animation, the character is created using modeling software. This involves
shaping the character's geometry and defining its features, such as the face, body, and clothing.
4. Keyframe Animation: Keyframe animation involves setting key poses or positions for the
character at specific frames in the animation timeline. These key poses define the character's
movements and expressions throughout the animation sequence.
7. Facial Animation: Facial animation involves animating the character's facial expressions,
including movements of the eyes, eyebrows, mouth, and other facial features. This can be done
manually using keyframe animation or with techniques like blendshapes or facial motion
capture.
In computer animation, periodic motions are often implemented using a combination of keyframe
animation, procedural techniques, and scripting. Animators may use mathematical functions,
simulation algorithms, or procedural noise patterns to generate and control periodic motions,
depending on the desired effect and level of realism required. Additionally, animation software and
frameworks often provide tools and features specifically designed to facilitate the creation and
manipulation of periodic motions in animations.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 14 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-
OpenGL is a powerful graphics API commonly used for rendering 2D and 3D graphics in computer
animation and game development. While OpenGL itself does not provide built-in animation
procedures, it offers a framework for implementing animation through various techniques and
approaches. Here's a general overview of the procedures commonly used for animation with OpenGL:
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 15 | 16
RV Institute of Technology & Management®
-----------------------------------------------------------------------------------------------------------------------------------------
-
2. Interpolation: Interpolation is commonly used to create smooth animations between
keyframes. This involves calculating intermediate values between two keyframes to create the
illusion of continuous motion. Linear interpolation (LERP) is a simple interpolation technique
where values are linearly interpolated between two endpoints. Other interpolation techniques,
such as spline interpolation or Bezier curves, can also be used for more complex animations.
4. Animating with Shaders: OpenGL shaders can be used to implement various animation
effects directly on the GPU. For example, vertex shaders can be used to deform geometry or
simulate movement, while fragment shaders can be used to create dynamic color changes or
visual effects. By manipulating shader parameters over time, complex animations can be
achieved with OpenGL.
____________________________________________________________________________
Computer Graphics & Fundamentals of Image Processing (21CS63) Page 16 | 16