Index

SchoolNotes

  1. CS225
    1. OOP
      1. Inheritance
      2. R-Value References
    2. Misc Notes
    3. Size/Offsets of Structs/Classes
    4. Week 4
  2. CS200
    1. Introduction
    2. Scan Conversion
    3. Quiz 01
  3. GAM200
    1. Notes
  4. CS180
    1. Introduction
    2. Midterm Revision
    3. Finals Revision
    4. Memory
    5. ELF Format
    6. History of Computers
    7. Stuff to Research
    8. Quiz To-Do
    9. OS Architectures
    10. Week 3
    11. Week 4
    12. Week 5
    13. Week 6 (Threads)
    14. Week 7 (Scheduling)
    15. Week 8 (Thread Scheduling)
    16. Week 9 (Memory Management)

Scan Conversion

Scan Conversion



images\13-1.png

Culling is removing a certain part of the image (for example, if the camera is only showing a certain section).

Clipping is used to obtain the VISIBLE part of a certain object... The rest will be clipped out.

Viewport transform refers to the final “piece of paper” on which the image will be created. It might be smaller or bigger.

Scan Conversion is used to figure out which pixels to “light up” - rasterization.

A framebuffer (frame buffer, or sometimes framestore) is a portion of RAM containing a bitmap that is used to refresh a video display from a memory buffer containing a complete frame of data. You flush it to “refresh” it.

images\13-2.png

The deflection plates are used in order to get the position of the light. The one gun is used for the entire screen.

Horizontal lines are called scanlines, Vertical lines are called columns

IMPORTANT - the coordinate system for the screen flips te y axis from the normal - downwards is positive!


The top left is also SOMETIMES 0,0 and SOMETIMES -0.5,-0.5


--------------------

3000x1000
Width x Height
Columns x Rows
Don't get confused!


--------------------


Graphical images are created by creating discrete data from continuous data from a signal.

--------------------

Integers are normally used for graphics because in floating point the inaccuracy is not linear. You can only represent certain numbers from 0-1, and the number of numbers you can represent from 1-2 are different.

--------------------

Supersampling is getting the average of the colors for a certain pixel in memory and showing that color for that pixel. (16 parts) (expensive)

Multisampling, also known as multisample antialiasing (MSAA), is one method for achieving full-screen antialiasing (FSAA). With multisampling, each pixel at the edge of a polygon is sampled multiple times. For each sample-pass, a slight offset is applied to all screen coordinates. (Wikipedia) (chooses less parts and is less intensive but is less accurate)

--------------------

Window to the world =/= Viewport
Window to the world is which part of the world you're viewing. (For example, a smaller window will allow for zoom)
The viewport is what part of the actual screen is drawn on.

--------------------

Normalized for graphics = -1 to +1


--------------------


VIEWPORT TRANSFORM FORMULA

It's the same slope in both. Remember to flip the y.

images\13-3.png

Prasanna's solution:



images\13-4.png
Truncuation:
images\13-5.png


--------------------

When the slope of the line is below 1, sample ALONG the x axis, if the slope of the line is above 1, sample ALONG the y axis.
images\13-6.png


--------------------

images\13-7.png
images\13-8.png
THIS IS WRONG!! m should not always be incrementing!! If delta y is negative, m should be negative.

images\13-9.png
images\13-10.png

For a line whhere the slope is less than 1:
The next square chosen is to east or northeast.

Bresenham's Formula https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html