discussion_week_06
ECE 391 Discussion
Copyright By PowCoder代写 加微信 powcoder
Announcements
! Midterm 1 today at 7:00pm
! MP2.1 is due on the following Tuesday (Oct 5)at 5:59 pm
! Grade sheets for checkpoint 1 & 2 on course site soon
! MP2.2 is due the following week (Oct 12) at 5:59pm
! Plan your time accordingly!
Mode X (cont.)
! Build buffer
Mode X (cont.)
! The img3 and img3_off variables provide the additional level of
indirection. At any point in time, adding the address calculated from
the logical view window coordinates (show_x, show_y) to the img3
pointer produces a pointer to the start of plane 3 in the build buffer
Mode X (cont.)
! Algorithm to display images with a multitude of colors on devices
that can only display a limited number of colors (color quantization)
! .photo files
! Each pixel is 16-bits: RRRRRGGGGGGBBBBB
! 1st 64/256 VGA palette colors already set up and used by game objects
! Other 192 colors are for you to represent the room photos
! Use arrays, not a pointer-based data structure
! Use 64 colors for the 2nd level nodes and the remaining 128 to
represent the nodes in the 4th level
! Don’t leave “holes”!
Octrees (continued)
1. Count the number of pixels in each node at level 4 of your octree
2. Sort the level 4 nodes based on the count and select the most
frequent 128
a. Need to keep track of the original order. How?
3. Calculate the averages for red, green, and blue separately for the
most frequent 128 level 4 nodes and assign them to the palette
a. Note that red and blue are 5 bits while green is 6 bits!
b. You should be able to figure out the VGA index from here
4. Repeat 3 for level 2 nodes
a. Remember to remove the contribution of any pixels assigned to the level
b. There’s a more efficient way than just simply repeating steps 1-3 again
5. Finally, reassign the colors to each pixel of the room photo
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com