ASSIGNMENT # 1: GRAPHIC PACKAGES AND DATASTRUCTURES - OPENGL DISPLAY
Q. I noticed there is a makefile example on the assignments page for using the gcc compiler on Unix. Is this required, or am I free to use MS Visual Studio in doing the assignment?
A. This makefile in this example is prepared for compiling and running OpenGL programs on U.A. ECE computer network, the same computer network you got instructions for and have set up an account for yourself. We will run and test everyoneís program on ece computers. Regardless of what platform you decide to program on, you final turned in programs must execute correctly on the ece computer network to receive credit.
Q. Do you prefer us to use GLUT, or is native Win32 ok?
A. Your program needs to work with GLUT and gcc on the ece computer. This will be the only way we can run and test the programs for all students in the class.
Q. I could not manage to get the X windows server on my machine to render assignment1. I could compile it and link it fine, but I kept getting OpenGL runtime errors about incompatibilities with the display device when I invoked it. I could run xterm and the like with no problems.
A. We have posted a handout under a link entitled ďOpenGL and X windows How toĒ on the handouts page of the class website:
In there, we have summarized all the useful information we could about how to get OpenGL running from or at a remote location. Please take a look at it, and it should help with your question for both assignment 1 , and any other assignment needing OpenGL.
If you would like to run OpenGL on your own PC, the best way is to do this under Linux. So you may want to install Redhat Linux (which is public and usually comes with a free version of X libraries) on your PC if you don't have this already. On the other hand if your machine is a workstation ( Sun, SGI, etc) running unix, then you should be able to directly use the instructions in that handout to compile and run your programs on ece2 and set up your local machine as a display client.
Q.I am having difficulties with
with openGL when the window is resized.
I have tried placing the lines suggested (gluLookAt, glMatrixMode, glIdentity
...) in the display routine, in the resize routine, in both routines,
and I still have no luck.
To explain what is happening the drawing initially comes up correctly but when I resize the window, only the background seems appears. I don't know if the object is not being drawn, or if the background is drawn over the object, or if the object is drawn off the page, or if view is not being setup correctly.
A.The problem you are having is
coming about because
you are not reinitializing your
modelview matrix the second and subsequent times through display. This causes the
previously composed matrix to be composed with the new version of the matrix.
What you need to do is to reload the identity matrix at the
beginning of the display callback (assuming you are in MODEL_VIEW mode.)
ASSIGNMENT # 2: VIEWING AND TRANSFORMATIONS.
Q. This is regarding Part 3 of the assignment. In class
you talked about u2 and Vup. My Understanding is that u2 is
the vector along the y direction of the Viewplane and I have used the following:
u1 = I
u2 = j*cos(t) + k*sin(t)
vpn = -j*sin(t) + k*cos(t)
Is this what you had intended or were you referring to something different?
A. Vup should be in direction of
y axis (0,1,0). Therefore to get u2 axis ( or V axis) on the picture plane
use the projection of (0,1,0) onto the picture plane. So if direction
of projection is Vpn (assuming it is a normalized unit vector), then u2 should
(Vup Ė Vup.Vpn) / | | . | | where the denominator is just the magnitude of the numerator (normalization). With Vpn and Vup, you can get u1 (or U axis), it should be U2 x Vpn.
Q. Calculating X, Y coordinates on the viewport.
Iíve multiplied the matrices and have obtained the equations for the x and y coordinates on the viewport. I code these equations directly in my program rather than using matrix multiplication routines. (The reason for this is Iím not sure how to access the values calculated after matrix multiplication inorder to perform the appropiate clipping, and dividing the x and y by the fourth argument).
Is this acceptable or are we required to use the matrix multiplication routines to perform clipping, and converting the calculation into physical coordinates?
A. What you are doing is also acceptable. However, you can also do one of two things: (1) write your oown simple matrix and vector multiplication funstions, or (2) get OpenGL to do matrix operations for you. In OpenGL, at any time you have a working matrix (initially this should be initialized to identity). Then you use the function MatrixMult to multiply an original matrix with a new matrix whose elements you supply via a pointer to this new matrix. For additional explanation and example of this, you can find it described in the OpenGL handout.
Q. Specifying Viewport size:
Iíve made my program take a specified film size and display the film border . Since the original size of the window is not specified, what x and y coordinates should I be using ?
A. Simply create a large enough window such that any viewpoint with a distance between 20 cms and 100cms from the checker board can work for it.
Q. Camera Distance from the Checker Board:
What should be the camera distance from the board?
A. Assume that the camera distance
from the checker board is no less than
15cm. This minimum distance should ensure that no part of the board
falls behind the camera.
Q. From the picture it is not clear if the ellipse lays on the yz plane or xy plane . Which plane is it on?
A. The ellipse is intended to be on the xy plane.
Q. From the location of the ellipse and the direction of projection, I understand that this is an oblique projection ( cavalier projection to be exact because the angle between the optic axis and z axis is 45 deg, and we want to preserve dimensions of the ellipse )?
A. It is an oblique projection, but not necessary Cavalier. The dimensions are not preserved.
ASSIGNMENT # 3: CURVES
Question on Ferguson and Bezier Curves:
Q. The problem states let the values for alpha 0 and alpha 1 be all pairs of 10, 25 and 50. However, in class we always defined Rdot = Sdot * T(0) You have also made reference to Sdot as alpha in class. Therefore, am I correct in interpreting alpha 0 = Sdot (0) and alpha1 = Sdot(1)?
A. Yes, you are correct, alpha0 = Sdot(0) and alpha1 = Sdot(1).
Q. This problem states the value of the parameter (t) in the parametric equations ranges from 0 to 1. Iím assuming this is for the drawing of the generated curves9 (using OpenGL). Iím assuming we are asked to use 100 samples (points) in creating the curve drawing in OpenGL (99 segments). Is this correct ?
A. Yes, your understanding is correct. 100 is just the resolution we are choosing for the parameter t which has a range of 0 to 1.
Q. For the Ferguson curves question, are alpha0 and alpha1 extra parameters? They don't seem to fit anywhere in the curve generating equations: P0, P1, T0 and T1 are given. Aren't these are the only values used in the matrices? What do we need alphas for?
A. You need alphas to complete the relationship between T, which represents the unit tangent, and Pí (P prime or P dot) for each endpoint of curve segment.
Q. What should be the output of our program for this problem? Table of coordinates, or drawing of the curves?
A. The output should be the drawing of the curves.
ASSIGNMENT # 4: SOLID MODELS, SURFACES, FEATURES
Q. How do I get the hardcopy of Ď wireframe.psí file ?
A. To print a wireframe model, you need to use the following command
(view:postscript "filename.ps" x-size y-size)
Q. How do I terminate ACIS properly? Does it make a difference how I terminate ACIS?
It is VERY IMPORTANT to terminate ACIS properly.
There have been several instances
of people improperly exiting from ACIS (by simply closing the window)
without quitting the ACIS application,
This leaves the ACIS process to keep on running after your exit.
To terminate ACIS properly, type
in the command window (this is the same window where you give instructions for building your three-dimensional model).
AGAIN, DO NOT SIMPLY LOGOUT using the mouse, and DO NOT KILL THE WINDOW. This will not end your ACIS program. The process will continue to run on the machine.
Q. You ask for the drawing and the solid model to be turned in for this assignment. What is meant the Drawing? Is this the Wireframe ?
A. Yes, By "the drawing" it is meant the wireframe model of the object.
Q. In the solid modeling problem, Iíve no trouble creating
the shaded solid model using the render command, but the psprint command
to print the ps file is not working correctly.
The ps file is created but it does not print out correctly.
Also, Iím not sure why, but I was having some disk space problems.
However, I can successfully take a snapshot and then print the gif .
A. Your problem is caused because the shaded solid model file is very large. Not all printers are able to handle a file of that size. For the purpose of the assignment, taking a snapshot and printing the gif file will also be fine.
Q. What is the neutral file that is to be turned in ? is this the .sat file ?
A. There are several equivalent words used to refer to boundary representation (Breps) by
different modeling systems in the market. Some call it Brep export file, some call
it neutral data file, etc.
The ACIS version of boundary-representation
/ neutral file is what it produces as .sat file.