2081 3

CSC214 ยท 2081 ยท 10 marks

Explain RGB color model. Differentiate between virtual reality and augmented reality with examples. Explain Binary Space Partitioning (BSP) trees with a suitable example.

Explain RGB color model. Differentiate between virtual reality and augmented reality with examples. Explain Binary Space Partitioning (BSP) trees with a suitable example.[10]

Computer GraphicsChapter 6: Solid ModelingBinary Space Partition Trees

Quick answer

The RGB (Red, Green, Blue) color model is an additive color model used in computer graphics and display systems. It is based on the principle that a wide range of colors can be produced by combining three primary colors of light: Red, Green, and Blue.

Answer: RGB Color Model, VR vs AR, and BSP Trees


1. RGB Color Model

Key Principles

  • Additive Color Mixing: Colors are created by adding light. When all three primaries are combined at full intensity, white is produced. When all are absent, black is produced.
  • Each color component has an intensity value typically ranging from 0 to 255 (in 8-bit representation) or 0.0 to 1.0 (normalized).
  • The model is directly tied to how CRT monitors, LCD screens, and projectors emit light using red, green, and blue phosphors or sub-pixels.

Color Representation

A color is represented as a triplet: (R, G, B)

ColorRGB
Red25500
Green02550
Blue00255
White255255255
Black000
Yellow2552550
Cyan0255255
Magenta2550255

Advantages

  • Directly maps to hardware display technology (raster scan monitors).
  • Produces a much wider range of colors than older methods like the beam penetration method.
  • Produces realistic images.

Disadvantages

  • It is device-dependent (colors may vary across different monitors).
  • Poor resolution in some hardware implementations (as noted in shadow mask systems).
  • Difficult to align all three color beams precisely on the same hole in shadow mask CRTs.

Diagram

        Green (0,255,0)
           /    \
          /      \
  Cyan --+--Yellow
         |
  Blue --+-- Red
(0,0,255)    (255,0,0)
         \      /
          \    /
          Magenta
              |
           White (center)
           Black (origin)

2. Virtual Reality (VR) vs. Augmented Reality (AR)

Definitions

Virtual Reality (VR): Virtual Reality creates an entirely virtual world that replaces the real world. The user is fully immersed in a computer-generated environment. It is generally achieved by wearing a helmet or goggles having VR technology.

Augmented Reality (AR): Augmented Reality is the result of using technology to superimpose information such as sound, images, and text on the world we see. AR is a mix of the real world and the virtual world. It expands our physical world by adding layers of digital information on it. This is typically achieved by holding a smartphone in front of us.

Types of Augmented Reality

There are four types of AR today:

  1. Markerless AR
  2. Marker-based AR
  3. Projection-based AR
  4. Superimposition-based AR

Comparison Table

BasisVirtual Reality (VR)Augmented Reality (AR)
WorldCreates an entirely virtual worldMix of real world and virtual world
DifferentiationHard to differentiate between real and virtualUsers can clearly distinguish between both worlds
InteractionUser interacts only with the virtual worldUser interacts with both real and virtual worlds
HardwareAchieved by wearing a VR helmet or gogglesAchieved by holding a smartphone in front of us
ImmersionFully immersive experiencePartially immersive experience
Real WorldReal world is completely replacedReal world is enhanced with digital overlays

Examples

  • VR Example: A user wearing an Oculus Rift headset is placed inside a fully simulated 3D game environment where everything they see is computer-generated. Medical students can practice surgery in a fully virtual operating room.

  • AR Example: Pokemon GO is a popular AR game where virtual Pokemon characters are superimposed on the real-world camera view of a smartphone. Similarly, IKEA Place app lets users place virtual furniture in their real room using a phone camera.


3. Binary Space Partitioning (BSP) Trees

Definition

A Binary Space Partitioning (BSP) tree is a data structure used in computer graphics where a scene is recursively subdivided into two sections (FRONT and BACK) at each step using a plane that can be at any position and orientation.

From the notes: "It is a generic process of dividing a scene into two until the partitioning satisfies one or more requirements. It is a way of grouping data so it can be processed faster."

Key Characteristics

  • The cutting planes can be positioned and oriented to suit the spatial distribution of objects, making BSP trees more efficient than octrees.
  • BSP trees reduce the depth of the tree representation compared to octrees, thus reducing search time.
  • They are useful for:
    • Identifying visible surfaces
    • Space partitioning in ray-tracing algorithms
  • Many 3D modeling and rendering programs use BSP trees to make rendering faster.

Construction of a BSP Tree

The construction process (from the notes) is as follows:

  1. A space containing a 3D scene is recursively divided into two parts: FRONT and BACK with respect to the viewport, by selecting any surface as a dividing plane.
  2. The recursive subdivision is repeated until each half-space contains a manageable number of objects.
  3. The subdivision process is represented as a binary tree with the initial partitioning plane as the root node.
  4. The FRONT object is represented as the left node of the tree.
  5. The BACK object is represented as the right node of the tree.
  6. Each partitioning plane in a subspace becomes an internal node of the tree, and the recursion continues until every leaf holds a small, manageable set of surfaces.

Example

Consider a simple scene of three polygons A, B and C viewed from the position shown, where plane P1 is chosen along polygon A.

                 View position
                      |
        ----- P1 (plane of A) -----
         Front of P1      Back of P1
            B                 C

The construction proceeds as follows. Polygon A is selected as the first partitioning plane, so A becomes the root. Polygon B lies in the half space in front of P1, so it goes to the left subtree, and polygon C lies behind P1, so it goes to the right subtree. If a polygon straddles the plane, it is split along the plane and the two pieces are placed in the two subtrees.

            A  (root, plane P1)
           /   \
   front  B     C  back

To display the scene the tree is traversed back to front relative to the viewer, which for a viewer in front of P1 means the back subtree first, then the root polygon, then the front subtree, giving the drawing order C, A, B. Because nearer surfaces are painted after farther ones, hidden surfaces are removed correctly without any depth comparison per pixel, and the same tree gives a different but still correct order for any other viewing position.

Advantages and Limitations

AdvantagesLimitations
Correct visibility order for any viewpoint from a single precomputed treeThe tree must be rebuilt when the geometry moves
Shallower than an octree, so searching is fasterSplitting polygons that straddle a plane increases their number
Cutting planes can be oriented to suit the sceneThe choice of splitting plane strongly affects the tree quality

4. Conclusion

The RGB model is an additive model based on the three primaries red, green and blue arranged along the axes of a unit cube, with black at the origin, white at the opposite corner and the greys along the main diagonal, and it is the model used by every emissive display. Virtual reality and augmented reality differ in how much of the real world survives: VR replaces it with a wholly synthetic environment seen through a headset, whereas AR keeps the real scene and overlays digital content on it, as Pokemon GO and IKEA Place do on a phone. BSP trees serve a different purpose again, organising the scene itself: by recursively splitting space into front and back half spaces about chosen planes, they store a scene in a form that yields a correct back to front drawing order for any viewpoint, which is why they underlie visible surface determination and ray tracing acceleration.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.