Core Concepts in Computer Graphics and Virtual Reality

Understanding Pixels, Resolution, and Back-Face Detection

A pixel (short for picture element) is the smallest unit of a digital image or display screen. It represents a single point in a raster image and has a specific color and intensity.

Resolution refers to the number of pixels in an image or display, usually written as width × height (e.g., 1920×1080). Higher resolution means more pixels, which leads to sharper and more detailed images.

Back-Face Detection Algorithm

Back-face detection is a hidden surface removal technique used in 3D computer graphics to remove faces (polygons) of an object that are not visible to the viewer. If a polygon (usually a triangle or quad) is facing away from the viewer, it will not be visible and should not be rendered. These polygons are called back faces.

Steps of the Algorithm:

  1. For each polygon, calculate the surface normal vector.
  2. Calculate the view vector (from viewer to the object).
  3. Compute the dot product of the surface normal and the view vector.
  4. If the result is greater than or equal to 0, the polygon is a back face and is not displayed.

How Flood Fill Algorithm Fills a Polygon

The Flood Fill algorithm is a region-filling algorithm used to fill connected areas in a computer graphics image, often found in paint programs. It starts from a seed point (inside the polygon) and spreads to neighboring pixels until it hits the boundary color. It then fills the region with a new fill color.

Steps to Use in Polygon Filling:

  • Choose a seed point inside the polygon.
  • If the color of the current pixel is not the boundary color and not the fill color, then:
    1. Fill it with the new color.
    2. Recursively call flood fill for neighboring pixels (4 or 8 directions).
  • The algorithm continues until it reaches the boundary of the polygon.

Window to Viewport Transformation Explained

Window to viewport transformation is the process of mapping coordinates from a world coordinate system (window) to a device coordinate system (viewport). The window is a portion of the world coordinates that you want to display. The viewport is the area on the screen (device) where the window contents will appear.

Mapping from Window to Viewport:

Let:

  • Window: Xwmin, Xwmax, Ywmin, Ywmax
  • Viewport: Xvmin, Xvmax, Yvmin, Yvmax

For any point (Xw, Yw) in the window, the corresponding viewport point (Xv, Yv) is calculated using scaling and translation factors. (The specific formulas for Xv and Yv are typically provided here, but are not included in the original text.)

I3 in Virtual Reality: Immersion, Interaction, Imagination

I3 in Virtual Reality stands for:

  • Immersion: The feeling of being present in a virtual world.
  • Interaction: The ability to interact with the virtual environment in real-time.
  • Imagination: Using the power of the mind to enhance and experience the virtual world.

Immersive vs. Non-Immersive Virtual Reality

Here’s a comparison of immersive and non-immersive virtual reality:

FeatureImmersive Virtual RealityNon-Immersive Virtual Reality
User ExperienceFully surrounds the user in a VR worldPartially simulates a virtual environment
Realism & InteractionHighly realistic and interactiveLimited interaction and realism
Typical HardwareVR headset, gloves, motion trackingMonitor, keyboard, mouse
ExamplesOculus Rift, HTC Vive3D simulation on desktop, video games
CostVery highLow to medium
ApplicationsTraining, gaming, therapyCAD software, virtual tours

Key Concepts in Computer Graphics

a) Polygon Clipping

  • Definition: Polygon clipping is the process of removing parts of a polygon that lie outside a defined clipping window.
  • Purpose: Used in graphics to ensure only visible portions of shapes are drawn.
  • Algorithm: The most common polygon clipping algorithm is the Sutherland-Hodgman algorithm.
  • Working: Each edge of the polygon is tested against the clipping window boundaries, and only the inside portions are retained.

b) RGB vs. CMY Color Models

FeatureRGB Color ModelCMY Color Model
Full NameRed, Green, BlueCyan, Magenta, Yellow
TypeAdditive color modelSubtractive color model
Primary UseDisplays (monitors, TVs)Printing (printers, copiers)
Color CreationColors created by adding lightColors created by subtracting light
Result of All ColorsRed + Green + Blue = WhiteCyan + Magenta + Yellow = Black (ideally)
Absence of ColorNo color (absence of RGB) = BlackNo color (absence of CMY) = White

c) Designing Animation Sequences

  • Definition: It refers to planning and creating the steps or frames of an animation.
  • Steps:
    1. Storyboarding: Drawing key scenes to visualize the story.
    2. Key Frame Design: Creating important positions of the object in motion.
    3. In-betweening (Tweening): Filling in the frames between keyframes.
    4. Timing and Spacing: Deciding speed and smoothness of movement.
  • Tools: Animation software like Blender, Maya, or Flash.
  • Goal: To create smooth and realistic motion.

Display Technologies: Beam Penetration vs. Shadow Mask

This section is incomplete in the provided document. It would typically differentiate between the beam penetration method and the shadow mask method for color displays, and then explain how a raster scan display system works.