A. Yes. It is located in
/usr/class/cs248/assignments/assignment1/demo
This should help answer most questions about the look and feel
about the basic assignment.
don't know how to make %.cpp (bu42).
A. Make sure /usr/pubsw/bin
comes before
/usr/bin
in your PATH so that you run
/usr/pubsw/bin/make
.
A. Try approximating it with an N-sided polygon, for your
favorite value of N. If you're feeling adventurous, try looking at
gluDisk
.
A. gluDisk()
draws its circles at the
origin. You should change the origin of the coordinate system to
be wherever you want the circle to draw.
A. Read the OpenGL book.
A. As said in lecture, alpha is the level of transparency used for drawing a primitive. OpenGL just calls it the fourth component of the color (red, green, blue, alpha). See the book for information on how to use it.
A. You probably forgot to enable blending. See the OpenGL book.
A. First, note that circles do not have to be oriented (because they're symmetric). As for rectangles, the assignment requires three ways to orient them:
A. No. We use our own makefiles to build your submission. You should do all your work in the two files provided.
A. See the demo program.
A. Don't worry about that -- it's OK to have your brush strokes "hang over" the sides of the image if the window has been resized.
A. The framework automatically draws
workImg
whenever the window needs to be redrawn in
its entirety . So you should call
workImg->GrabScreen()
whenever you think it's
appropriate to save the contents of the screen.
This solution breaks down when you grab the screen while the
window is partially covered (i.e., if you're drawing into the
window while it's not in front). For extra credit, try saving a
list of strokes, and playing them back in the
Display
routine, rather than just saving pixels.
A. You need to call glFlush()
after issuing
a set of OpenGL commands to ensure that they are all handed to the
graphics hardware for drawing. Otherwise, they may sit in buffers for
a long time, waiting for more commands to come in before they are
issued.
A. Whatever you think is reasonable.
A. You can't. Draw onto the screen and grab the pixels
using workImg->GrabScreen()
. If you have some super
duper funky thing that needs to set individual pixels in the
work image, you can modify the Image
class any way
you want. But this is not necessary to do the assignment.
A. The math to do that involves some trigonometry we
haven't learned about yet. You should use the OpenGL matrix
modification routines like glRotate
. No point in
computing something yourself when the graphics system will do it
for you.
A. Because we thought it looked good, and it would take forever to draw an image if you only had one line.