#contents

** Week 1 Participation Topic 1 [#ic60457c]

- Question

As mentioned in Chapter 1, computer graphics are used in practically every industry and field. Pick your favorite industry or field (e.g., Entertainment, Computer Art, Image processing …) and share a graphical image, animation or video clip related to that field with the class. Be sure to describe the graphic and reference your source. 

- Answer

Entertainment is my favorite field. Especially, computer graphics revolutionized cartoon moves. They are used to make the movies real and give more power and sense of presence.

A few years ago, I first used Blender which is an open-source 3D authoring tool in a class at my previous college. At that time, I was very impressed with the movies made with Blender. The movies are introduced at www.blender.org/features-gallery/movies.

These works show not only excellent modeling and animation skills but also amazing rigging and shading skills.

** Week 1 Participation Topic 2 [#gfb48ab5]

- Question

Using your computer graphics display, provide its current screen resolution, refresh rate, aspect ratio and frame buffer size to support 32-bit color quality. Provide a screen shot of your configurations and show your calculations for the aspect ratio and frame buffer size. 

- Answer

#ref(CMSC405_W1_P2_1.png,,65%)

Aspect Ratio = 1280 : 800 = 8 : 5~
Frame Buffer Size = (1280 * 800 * 32) / {8 * (1,024 * 1,024)} = 3.90625 MB

Actually, I couldn't find the screen refresh rate on build-in LCD display in my MacBook. When I connect it to an external monitor, the rate is shown as below.

#ref(CMSC405_W1_P2_2.png,,65%)

By looking on the Internet, it seems to be not changeable, but I guess the rate by default is 60 Herz. This is because when I run Windows7 on my Mac with VMware Fusion and check the rate, it is 60 Herz as below.

#ref(CMSC405_W1_P2_3.png,,80%)

** Week 1 Participation Topic 3 [#q9e0c3a2]

- Question

Pick an input device listed in chapter 2 (section 2-4) that you don’t use very often and conduct some quick research regarding available products and the types of application this device is typically used. Be sure to provide your references. Include graphics or images where appropriate. 

- Answer

''Digitizers'': According to the text (pp.28-29), digitizers are input devices such as graphics tablets, acoustic tablets, and three-dimensional tablets for drawing, painting, or interactively selecting positions.

I have never used any digitizers, but I actually found two of my co-workers who are web designers have a graphics tablet. Both of them use an Intuos made by Japan-based Wacom Corporation, an originally electronic CAD software vender, for drawing and retouching pictures.

According to them, Wacom is the strongest in graphics tablet market especially in Japan, and its entry model Bamboo is also very popular.

[[Bamboo Create:http://www.wacom.com/~/media/WTC/Images/Products/Bamboo/Bamboo%20Create/Gallery/800x600_CTH670_02.jpg]]~
[[Intuos5 touch Medium:http://www.wacom.com/~/media/WTC/Images/Products/Intuos5/Intuos5%20Medium/Gallery/800x600_PTH650_1.jpeg]]

** Week 1 Formulas [#d71b6d9a]

- %%Frame Buffer Size (bits) = Max VGA (X * Y) * Color depth (in bits)%%
- %%Frame Buffer Size (bytes) =  Max VGA (X * Y) * Color depth (in bits) / 8%%
- %%Frame Buffer Size (kilobytes) =  Max VGA (X * Y) * Color depth (in bits) / (8 * 1024)%%
- %%Frame Buffer Size (megabytes) =  Max VGA (X * Y) * Color depth (in bits) / (8 * 1024 * 1024)%%
- %%Frame Buffer Load Time (seconds) = Max VGA (X * Y) * Color bit depth (in bits) / Memory bandwidth (transfer rate) (bps)%%
- [Memory Bandwidth in GB/s] = [Graphics Card Process Speed in MHz] x [1,000,000 Hz /1 MHz] x [Memory Interface in Bits ] x [1 Byte/8 Bits] x [Memory Type multiplier] / [1GB/1,000,000,000 Byte]
- [Frame buffer load time in millisecond] = ([Vertical resolution] x [Horizontal resolution] x [Bits per pixel]x [1000 ms/1s]) /([Memory Band width in GB/s]x[1,000,000,000 Bytes/1GB])x[8 bits/byte])
- [Frame buffer size in bytes] = [Vertical resolution] x [Horizontal resolution] x [Bits per pixel] /[8 bits/1byte] x[1 MB/1,000,00 bytes]

** Week 1 Homework [#xac11dfa]

#ref(CMSC405_Week1_Homework.pdf)

** Week 2 Participation Topic 1 [#d13b8dbc]

- Question

Conduct some research on the web to find a current example of a graphics package (see section 3-4 with some package listings). You may be using this package right now or you might be interested in using it down the road. Briefly describe the package and its most popular features. Be sure to provide a screen capture highlighting its computer graphics capabilities.  Also, be sure to provide the URL with the additional product descriptions and contact information.

- Answer

I chose LightWave 3D, a rival product of Autodesk Maya and 3ds Max, which allows 3D computer graphics creators to do modeling, animation, and redering deleloped by New Tek based in San Antonio, Texas. Since the software is cheaper than Maya and 3ds Max, so it is popular among all the 3DCG creates including amateurs. Actually, Rob Powers, LightWave 3D group's president, originated Virtual Art Department for James Cameron on AVATAR.

[[LightWave:https://www.lightwave3d.com/]]~
[[New Tek, Inc.:http://www.newtek.com/]]

Here are examples of work made by LightWave from LightWave gallery~
[[Winter:https://www.lightwave3d.com/static/media/uploads/gallery_images/architecture/sebastian_smolak-winter_mix.jpg]]~
[[MS-06S ZAKU II:https://www.lightwave3d.com/static/media/uploads/gallery_images/sci-fi/bruno_taglienti-zaku_red3.jpg]]~
[[Eugene:https://www.lightwave3d.com/static/media/uploads/gallery_images/character/mauro_corveloni-eugene2.jpg]]~
[[Island:https://www.lightwave3d.com/static/media/uploads/gallery_images/landscape_and_nature/adam_sharp-island_01.jpg]]~
[[VAD Avatar Jungle:https://www.lightwave3d.com/static/media/uploads/gallery_images/film/avatar-vad_rainforest_gorge.jpg]]

** Week 2 Participation Topic 2 [#i3660ec5]

- Question

After you have successfully installed and configured your C++ OpenGL environment, show the results of compiling and running one the foundational SGI redbook examples.

(http://www.opengl.org/archives/resources/code/samples/redbook/)

Then take one of the examples and modify the code slightly (just one or two minor changes in the code) and recompile and show the results. Explain the code changes you performed and show the resulting output. (Note: We haven’t gone over all of the code yet, so It is not expected for you to understand all of the functionality, but you should be able to “experiment” with existing code and realize we will go into more details with the functionality throughout the semester)

Here is another link that should provide the same resources.

http://www.sgi.com/products/software/opengl/examples/redbook/  

- Answer

I chose picksquare.c. This program shows a 3x3 grid of squares is drawn. When you click on a square, the color of the square changes. Simply, I changed the parameters of glColor3f function in drawSquares, a call back function, which takes R, G, and B as its parameters. The values are between 0.0 and 1.0. A larger number means a higher brightness.

Here is an original function.

#ref(glColor3f_3.0.png)

 void drawSquares(GLenum mode)
 {
 ..........
            glColor3f ((GLfloat) i/3.0, (GLfloat) j/3.0, 
                       (GLfloat) board[i][j]/3.0);
 ..........
 }

Here are modified ones.

#ref(glColor3f_2.0.png)

 void drawSquares(GLenum mode)
 {
 ..........
             glColor3f ((GLfloat) i/2.0, (GLfloat) j/2.0, 
                        (GLfloat) board[i][j]/2.0);
 
 ..........
 }

#ref(glColor3f_5.0.png)

 void drawSquares(GLenum mode)
 {
 ..........
             glColor3f ((GLfloat) i/5.0, (GLfloat) j/5.0, 
                        (GLfloat) board[i][j]/5.0);
 ..........
 }

** Week 2 Questions and Comments [#a95691b3]

- My question

Do you have a recommendation for setting up an OpenGL environment on Mac OS X Snow Leopard (10.6)? Mac OS X has GLUT and OpenGL frameworks by default.

Actually, I am thinking to use XCode including gcc itself because the application is already installed on my Mac and I can easily use the frameworks in XCode.

- Professor's answer

Thanks. I don't have a recent version of the MAC O/S up and running but I have heard what you just explained should work without issue.

I have also heard from other MAC users that the process of getting the environment up and running is much more straight forward because of the preinstalls.

Try those code examples from the red book (and my other examples in the code conference) and let me know your success.

Jimmy

** Week 2 Homework [#zb98f6e0]

#ref(CMSC405_yujishimojohw2.pdf)
#ref(CMSC405_yujishimojohw2_corrected.pdf)

** Week 2 Homework 1 [#xc5595a2]
** Week 2 Homework #1 [#xc5595a2]

- Question

Calculate the plane coefficients (A,B,C and D)  of 3 points in a plane defined by P1, P2 and P3, and determine if the point P4 is behind or in front of the polygon surface contained within that plane:~
P1 = (10,-20,40);~
P2 = (30,3,18);~
P3 = (-5,-10,25);~
P4 = (-10,12,-19);~
Be sure to show your work. Explain why determining if Point P4 is behind or in front of the polygon surface relevant to computer graphics applications.

- Answer

A= y1 (z2– z3) + y2 (z3– z1) + y3 (z1– z2)~
= -20*(18-25) + 3*(25-40) + (-10)*(40-18)~
= -20*(-7) + 3*(-15) + (-10)*22 = 140 -45 – 220~
= -125

B= z1 (x2 – x3) + z2 (x3 – x1) + z3 (x1 – x2)~
= 40(30 - (-5)) + 18(-5 - 10) + 25(10-30)~
= 40*35 + 18*(-15) + 25*(-20)~
= 1400 - 270 - 500 = 630

C= x1 (y2 – y3) + x2 (y3 – y1) + x3 (y1 – y2)~
= 10(3 - (-10)) + 30(-10 - (-20)) + (-5) (-20 - 3)~
= 10*13 + 30*10 + (-5)*(-23) = 130 + 300 + 115~
= 545

D=-x1 (y2 z3 – y3 z2) - x2 (y3 z1 – y1 z3) -x3 (y1 z2 –y2 z1)~
= -10*(3*25 - (-10)*18) -30*(-10*40 – (-20)*25) - (-5)*(-20*18 – 3*40)~
= -10*(75 + 180) -30*(-400 + 500) - (-5)*(-360 - 120)~
= -10*255 -30*100 – (-5)*(-480)~
= -2550 -3000 -2400~
= -7950

For Point P4:~
Ax + By + Cz + D~
= -125*(-10) + 630*12 + 545*(-19) + (-7950)~
= 1250 + 7560 – 10355 – 7950 = -9495~
Since -9495<0 P4 is behind the plane.

** Week 2 Homework 3 [#c534aeb7]
** Week 2 Homework #3 [#c534aeb7]

- GitHub Repository: https://github.com/yujishimojo/CMSC405_HW2
-- CMSC405_HW2.cpp

** Week 3 Participation Topic 1 [#b66490a4]

- Question

Using the boundaryFill4 algorithm shown on page 178, modify (you will definitely need to modify this algorithm to get this to work), implement and test the recursive algorithm for a small triangle you create.  Experiment, increasing the size of the triangle until you receive a stack-overflow error. Discuss why you received this error. What can be done to eliminate this issue?  (Hint: This is an issue with deep recursion) Consider the following functions to help you experiment:

 struct myColor{
     float red, green, blue;
 };
 
 void setPixel (GLint xPos, GLint yPos, myColor myc)
 {     
        glBegin (GL_POINTS);
          glColor3f (myc.red, myc.green, myc.blue);     
          glVertex2i(xPos, yPos);
        glEnd();    
        glFlush();
 }
 
 myColor getPixel(int x, int y){                   // gets the color of the pixel at (x,y) 
        myColor c;         
     glReadPixels(x,y,1,1,GL_RGBA, GL_FLOAT, (void *)color);
     c.red = color[0];  
     c.green = color[1];        
     c.blue = color[2];    
     return c;
 }

- Answer

Recursive processing can cause deadlocks especially in multi-thread programming. To eliminate this issue, for example, in Java, you can implement thread safe applications by using the synchronized modifier to your methods, I don't know exactly how to do so in C++ though.

** Week 3 Participation 2 [#jd558e23]

- Question

What is aliasing in terms of computer graphics or image processing? Try to show a visual example (youtube is fine) 

- Answer

In the terms of computer graphics, aliasing, also known as jaggies, is the stair-step effect on the edges of objects. This is because the display is composed of tiny pixels. The way of avoiding this problem is called anti-aliasing. One of the basic anti-aliasing methods is supersampling, or full-scene anti-aliasing (FSAA). The method is to increase the resolution of the display virtually. On the other hand, it can decrease the frame rate on your computer.

The video below gives a simple comparison among non anti-aliasing, FSAA, and FXAA developed by NVIDIA.

NVIDIA FXAA Overview and Comparison
http://www.youtube.com/watch?v=qmeNz0NTvFQ

** Week 3 Homework [#uad4d26f]

#ref(CMSC405_yujishimojohw3.pdf)

** Week 3 Homework 1 [#sb034167]
** Week 3 Homework #1 [#sb034167]

- Question

Given the 2 end points shown on the graph below, determine the slope, y-intercept and give the slope-intercept formula. Determine one additional point that would be on that line using the slope-intercept formula where the x value would be greater than 6. 

- Answer

''Slope:''~
P1 = (3, -10) and P2 = (6, 4);~
m = (4-(-10))/(6-3) = 14/3;~
''y-intercept:''~
b = -10-14/3*3 = -14+10 = -24;~
''Slope intercept form:''~
y = 14/3x-24~
''Additional point:''~
for x = 9:~
y = 14/3*9-24 = 18;~
P3 = (9, 18);

** Week 3 Homework 2 [#w3d1a415]
** Week 3 Homework #2 [#w3d1a415]

- Question

Using Visual C++ and your OpenGL configured environment, write an application that displays a graphical scene that displays a top-down, 2-D (non-animated) view of the Sun and at least 4 planets of our solar system. You can assume elliptical orbits for all of the planets in your scene. Sizes of the ellipses should be scaled to the actual distances from the Sun. You should include circles representing each of the planets and the Sun in your scene. Sizes of the objects should be scaled proportional to their actual size (with the exception of the Sun as it will be most likely too large to have other planet be visible). Be sure to label each of your planets and the Sun. In the submitted word document you submit, describe exactly how you scaled your planets and elliptical orbits. Be sure to reference your source for planet size, and distance from the Sun. (e.g. http://www.solarviews.com/eng/solarsys.htm)

** Week 3 Homework 3 [#ab99aecd]
** Week 3 Homework #3 [#ab99aecd]

- Question

Using Visual C++ and your OpenGL configured environment, write an application that plots the 2D parabolic trajectories for an object whose starting position is p1 = (500,400) with velocities, v = (30m/s,40 m/s),  for at least 4 different planets including Earth. Plot the trajectories using different line colors and styles for values of time increments of 1 second. Plot the trajectories only up to the first negative Y value. For example for each, the last 3 plotted points (x,y) might be: ~
~
860	174.4~
890	91.9~
920	-0.4~
~
Label the trajectories corresponding to the planets selected. Be sure to reference your source for gravity for the planets. A possible graphic display is shown below.

** Week 4 Participation 1 [#oc780257]

- Question

Modify the 2D composite programming example on pages 212-215 to plot a shape that is not a triangle or a rectangle. Plot the original shape and then translate, rotate and scale using parameters of your choice. Please show your Shape function (eg. Polygon()) your shape centroid code, list your transformation parameters, and a screen shot showing the results.

- Answer

#ref(Week4_P1.png,,50%)

 /* Shape */
 void polygon (wcPt2D *verts)
 {
     GLint k;
     glBegin (GL_QUADS);
     for (k = 0; k < 4; k++)
         glVertex2f(verts [k].x, verts [k].y);
     glEnd();
 }
 
 /* Initial position */
     GLint nVerts = 4;
     wcPt2D verts [4] = { {25.0, 75.0}, {75.0, 75.0}, {25.0, 25.0}, {75.0, 25.0} };
 
 /* Centroid */
     GLint k, xSum = 50, ySum = 50;
     for (k =0; k < nVerts; k++) {
         xSum += verts [k].x;
         ySum += verts [k].y;
     }
     centroidPt.x = GLfloat (xSum) / GLfloat (nVerts);
     centroidPt.y = GLfloat (ySum) / GLfloat (nVerts);
 
 /* Transformation parameters */
     GLfloat tx = 50.0, ty = 100.0;
     GLfloat sx = 1.5, sy = 1.5;
     GLdouble theta = pi/1.5;

** Week 4 Participation 2 [#n0428184]

- Question

Given points p1={10,10} and p2={30,10}, show the transformation matrix and resulting points for a shear in the x direction. You can pick any shear value in the range or -100 to 100 (for convenience pick an Integer value)

- Answer

Shear value = -50

Matrix:
#ref(Week4_P2.png)

p1 = {10, 10}
x' = 10 + (-50) * 10 = -490
y' = 10
p1' = {-490, 10}

p2 = {30, 10}
x' = 30 + (-50) * 10 = -470
y' = 10
p2' = {-470, 10}

** Week 4 Participation 3 [#ce04ffd5]

- Question

Provide the 4x4 matrices in row,column format for a set of Geometric transformations that include 30 degree rotation, translation of 50 in x direction and -100 in y direction, and with a scaling of 1.5 applied in both the x and y directions. 

- Answer

30 degree rotation in x direction:
#ref(W4_P3_X_Rotation.png)

30 degree rotation in y direction:
#ref(W4_P3_Y_Rotation.png)

30 degree rotation in z direction:
#ref(W4_P3_Z_Rotation.png)

Translation of 50 in x direction and -100 in y direction:
#ref(W4_P3_Translation.png)

Scaling of 1.5 in both the x and y directions:
#ref(W4_P3_Scaling.png)

** Week 4 Formulas [#h4ab70b1]

- Shear:
#ref(shear_formula.png)

- 2D Translation Matrix:
#ref(2D_translation_matrix_formula.png)

- 2D Rotation Matrix:
#ref(2D_rotation_matrix_formula.png)

- 2D Scaling Matrix:
#ref(2D_scaling_matrix_formula.png)

- 3D Translation Matrix:
#ref(3D_translation_matrix_formula.png)

- 3D X-axis Rotation Matrix:
#ref(3D_xrotation_matrix_formula.png)

- 3D Y-axis Rotation Matrix:
#ref(3D_yrotation_matrix_formula.png)

- 3D Z-axis Rotation Matrix:
#ref(3D_zrotation_matrix_formula.png)

- 3D Scaling Matrix:
#ref(3D_scaling_matrix_formula.png)

** Week 4 Homework [#g653a926]

#ref(CMSC405_yujishimojohw4.pdf)

** Week 5 Homework [#da2287f5]

#ref(CMSC405_yujishimojohw5.pdf)

** Week 6 Homework [#v9875d66]

#ref(CMSC405_yujishimojohw6.pdf)

** Week 8 FinalProject [#e468edd0]

#ref(CMSC405_yujishimojofinalproject.pdf)

- GitHub Repository: https://github.com/yujishimojo/CMSC405_FinalProject
-- CMSC405_FinalProject.cpp

- YouTube Video: [[My OpenGL/C++ project - 3D Mabuyer:https://www.youtube.com/watch?v=c2ti4OONRqA]]

** Websites [#sc437f06]

- [[OpenGL Programming Guide for Mac:https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html]]

- [[SGI Redbook Examples:http://www.sgi.com/products/software/opengl/examples/redbook/]]

- [[OpenGL.org Code Resources:http://www.opengl.org/wiki/Code_Resources]]

- [[OpenGL.org:http://www.opengl.org/]]

- [[OpenGL 2.1 Reference Pages:http://www.opengl.org/sdk/docs/man2/]]

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS