Week 1 Participation Topic 1

  • 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

  • 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

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.


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.


Week 1 Participation Topic 3

  • 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
Intuos5 touch Medium

Week 1 Formulas

  • 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

Week 2 Participation Topic 1

  • 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.

New Tek, Inc.

Here are examples of work made by LightWave from LightWave gallery
VAD Avatar Jungle

Week 2 Participation Topic 2

  • 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.


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.


  • 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.

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

Here are modified ones.

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

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

Week 2 Questions and Comments

  • 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.


Week 2 Homework

Week 2 Homework #1

  • 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

Week 3 Participation Topic 1

  • 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);

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

  • 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

Week 3 Homework #1

  • 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

P1 = (3, -10) and P2 = (6, 4);
m = (4-(-10))/(6-3) = 14/3;
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

  • 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

  • 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

  • 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
/* Shape */
void polygon (wcPt2D *verts)
    GLint k;
    glBegin (GL_QUADS);
    for (k = 0; k < 4; k++)
        glVertex2f(verts [k].x, verts [k].y);

/* 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

  • 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



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

  • 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:


30 degree rotation in y direction:


30 degree rotation in z direction:


Translation of 50 in x direction and -100 in y direction:


Scaling of 1.5 in both the x and y directions:


Week 4 Formulas

  • Shear:
  • 2D Translation Matrix:
  • 2D Rotation Matrix:
  • 2D Scaling Matrix:
  • 3D Translation Matrix:
  • 3D X-axis Rotation Matrix:
  • 3D Y-axis Rotation Matrix:
  • 3D Z-axis Rotation Matrix:
  • 3D Scaling Matrix:

Week 4 Homework

Week 5 Homework

Week 6 Homework

Week 8 FinalProject


添付ファイル: fileglColor3f_5.0.png 377件 [詳細] fileglColor3f_3.0.png 436件 [詳細] fileglColor3f_2.0.png 383件 [詳細] fileCMSC405_yujishimojofinalproject.pdf 886件 [詳細] fileCMSC405_yujishimojohw6.pdf 1204件 [詳細] fileCMSC405_yujishimojohw5.pdf 1008件 [詳細] fileCMSC405_yujishimojohw4.pdf 1131件 [詳細] fileCMSC405_yujishimojohw3.pdf 1416件 [詳細] fileCMSC405_yujishimojohw2_corrected.pdf 859件 [詳細] fileCMSC405_yujishimojohw2.pdf 1022件 [詳細] fileCMSC405_Week1_Homework.pdf 1257件 [詳細] fileshear_formula.png 440件 [詳細] file3D_zrotation_matrix_formula.png 514件 [詳細] file3D_yrotation_matrix_formula.png 503件 [詳細] file3D_xrotation_matrix_formula.png 507件 [詳細] file3D_translation_matrix_formula.png 523件 [詳細] file3D_scaling_matrix_formula.png 547件 [詳細] file2D_translation_matrix_formula.png 450件 [詳細] file2D_scaling_matrix_formula.png 453件 [詳細] file2D_rotation_matrix_formula.png 430件 [詳細] fileW4_P3_Z_Rotation.png 422件 [詳細] fileW4_P3_Y_Rotation.png 468件 [詳細] fileW4_P3_X_Rotation.png 506件 [詳細] fileW4_P3_Translation.png 447件 [詳細] fileW4_P3_Scaling.png 450件 [詳細] fileWeek4_P2.png 403件 [詳細] fileWeek4_P1.png 582件 [詳細] fileCMSC405_W1_P2_3.png 661件 [詳細] fileCMSC405_W1_P2_2.png 605件 [詳細] fileCMSC405_W1_P2_1.png 610件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-09-22 (火) 19:51:19 (1029d)