cnwtf2
cnwtf2
Table of Contents i
1 Introduction 1
2 Display List 2
2.1 Types of Display Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Advantages of Display Lists . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Limitations of Display Lists . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Modeling 5
3.1 Types of Models: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Modeling Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 Applications of Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4 Challenges in Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 Menus 10
5.1 Types of Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.2 Creating a Menu in OpenGL . . . . . . . . . . . . . . . . . . . . . . . . 11
6 Conclusion 12
i
Computer Graphics(BCS515A) 2024-25
Chapter 1
Introduction
Chapter 2
Display List
In computer graphics, Display Lists are an essential technique for optimizing the
rendering process by precompiling sequences of graphics commands. They allow for
the efficient reuse of graphical objects or scenes without having to reprocess the data
multiple times. Display lists are primarily used in rendering pipelines where complex
or repetitive objects need to be rendered several times, thus saving computational
resources and improving overall performance.
Example : In OpenGL, a display list might store commands to draw a 3D cube
model that is used repeatedly in a scene.
Simple Display Lists: These are basic display lists that contain simple, static
drawing commands. For example, a basic scene with unchanging objects such as ge-
ometric shapes (e.g., a cube or sphere) can be rendered using a simple display list.
Hierarchical Display Lists: These lists involve the use of multiple display lists
that are nested or linked together. In complex scenes, you might have a main display
list that calls other display lists for individual objects or components within the scene,
creating a more efficient structure for rendering complex environments.
Dynamic Display Lists: These lists are meant for cases where objects need to
be rendered frequently but still benefit from the performance optimization of display
lists. In such cases, the display list is recreated dynamically whenever the object
changes.
Reduced CPU Load: By offloading the drawing commands to the GPU and
minimizing the involvement of the CPU, display lists enable smoother and faster ren-
dering. The GPU can process the stored commands directly, reducing the time spent
on CPU-based computations.
Memory Efficiency: Display lists help save memory by reusing the precompiled
drawing commands. Once created, the display list can be invoked multiple times
without recalculating or re-executing the operations, reducing the need for repetitive
memory usage.
Static Content: Display lists are best suited for static or rarely changing content.
If objects within the scene change dynamically, the display list must be recreated,
which can result in performance degradation.
Limited Flexibility: More advanced rendering techniques, such as shaders or
real-time effects, may not integrate seamlessly with display lists. This limits their use
in more complex graphics pipelines that require dynamic computation or real-time
adjustments.
Memory Consumption: Although display lists optimize performance by stor-
ing precompiled commands in memory, they can consume significant GPU memory,
especially in systems with limited resources. Large and complex scenes may push the
limits of available GPU memory.
2.4 Application
Display lists are particularly useful in scenarios where repeated rendering of objects
is required. They efficiently render elements that are reused multiple times within a
scene, such as trees, buildings, or vehicles, by storing precompiled drawing commands.
They are also effective for rendering static geometry, such as terrain or background
objects, that do not require dynamic updates. By minimizing command overhead,
display lists help optimize performance, especially in scenes with complex geome-
try. In hierarchical models, such as scene graphs, display lists can represent reusable
subcomponents, like a wheel in a car model, allowing for more efficient rendering. Ad-
ditionally, display lists simplify animation by storing precomputed transformations or
object states, reducing the computational burden during frame rendering.
Chapter 3
Modeling
The process of defining the shape, size, and structure of objects in 2D or 3D space
is known as modeling. It involves creating representations of objects or environments
using various techniques and methods, depending on the complexity and requirements
of the scene.
Film and Animation: In the film industry, 3D modeling is used for creating
digital effects, characters, and environments. High-quality models allow filmmakers
to craft stunning visual effects that are integral to modern blockbuster films.
Virtual Reality (VR) and Augmented Reality (AR): In VR and AR, model-
ing techniques are used to create immersive experiences by designing 3D environments
and objects that users can interact with in real-time.
Chapter 4
Event Driven Input
Event-Driven Input: This programming paradigm determines the flow of the pro-
gram based on user actions or external events, rather than following a pre-defined
sequence. It enables systems to be more interactive and responsive to real-time in-
puts.
Keyboard Events: These events detect when a key is pressed on the keyboard.
For instance, typing a letter triggers the corresponding action, while releasing a key
after pressing it can trigger a specific action as well, such as submitting a form after
pressing the ”Enter” key.
Event-driven input plays a key role in creating interactive systems, where the flow
of the program responds dynamically to the user’s actions, such as mouse clicks, key
presses, or other external events. This approach makes applications more intuitive
and responsive to user input.
Example:
void handleKey(unsigned char key, int x, int y) {
if (key == ’q’) exit(0);
}
Chapter 5
Menus
Menus are graphical user interface (GUI) components that allow users to interact
with and navigate a program or application by selecting options from a structured
list. They provide an organized way to access various functions or settings within a
software application, offering a more intuitive user experience. Menus can be static
or dynamic, offering a range of actions such as opening files, changing settings, or
executing specific commands.
Chapter 6
Conclusion
In conclusion, Display Lists, Modeling, Event-Driven Input, and Menus are crucial
components in the development of interactive graphical applications. Display Lists
optimize performance by allowing precompiled rendering tasks to be reused, enhanc-
ing efficiency in rendering. Modeling enables the creation of intricate objects and
environments in 3D spaces, providing a foundation for realistic visual representations.
Event-Driven Input ensures real-time responsiveness, enabling dynamic user interac-
tion with the application. Menus offer intuitive navigation, empowering users with
simple and effective control options.
When combined, these techniques form a powerful framework that drives the devel-
opment of responsive, interactive, and visually engaging user experiences. Together,
they allow developers to craft sophisticated graphical applications, enabling users to
manipulate objects, navigate environments, and perform tasks seamlessly in a dy-
namic digital world.
References
1. Edward Angel: Interactive Computer Graphics A Top-Down Approach with
OpenGL, 5th Edition, Pearson Education, 2008.
2. Donald Hearn & Pauline Baker: Computer Graphics with OpenGL Version, 4th
Edition, Pearson Education, 2011.
3. John D. Foley, Andries van Dam, Steven K. Feiner, John F. Hughes, ”Computer
Graphics: Principles and Practice,” 3rd Edition, Addison-Wesley, 2013.