BONUS: You may create near, far, top, bottom, left, and right clipping planes. The user should be able to specify their coordinates (using a min-x, max-x, min-y, max-y, min-z, max-z method). In the orthographic projection, these clipping planes will form a rectangle. In the perspective projection, these clipping planes will form a truncated pyramid (frustum). You may use any reasonable method to allow the user to specify the clipping boundries. Clip the objects so they only exist within the confines of the clipping boundries. You should connect clipped edges. For example, if a corner of the cube was clipped, the clipped edges would be connected by a triangle.Again, GL and GLUT both contain functions that will perform these functions. YOU MAY NOT USE THEM. All lines must be drawn using your Bresenham line drawer and must be drawn to the canvas as in your previous two assignments. In addition to the above requirements, include:
To help make sure things are clear, I have included a demo program. It is compiled to run on the CADE Suns. It contains a single cube that can be rotated, translated and scaled. The axes are displayed by drawing an axis grid from the center of the cube through the appropriate faces. The red, green, and blue colors correspond to the X, Y, and Z axes respectively. The cube is drawn using the required perspective transform. You do not need to use the same interface, but will need your interface to do the same things (among others). PLEASE NOTE: this application implements a subset of the requirements for the project. It is your responsibility to get everything implemented. Send email to teach-cs4961@cs.utah.edu if you have questions.
This said it is ok if your objects are centered at some place other than the center of the screen BUT BE SURE TO DOCUMENT WHERE THEY ARE CENTERED. I will expect certain distortions at certain places on the screen and if that isn't the case (and if I don't see documentation explaining why that isn't the case) you will lose points. Best thing would be to simply have both your objects "centered" in the center of the screen. (You can then translate them a bit initially so they don't overlap if that bothers you.) Otherwise, be sure to be very clear where they are centered or risk losing points.
> If I create two objects, should they both appear in the screen at the same
> time or I can toggle them(For example, by clicking pyramid button. I erase
> the cube then draw the pyramid and do the translation).
Both object must be visible at the same time.
Second, due to how long it has taken me to get through all the projects from last time, the part of project 4 that uses clipping is now extra credit. You do not need to do this. I will update the web page momentarily.
> I can't seem to run the demo in the cade lab, it tells me I don't have
> "permission" to run it once I've downloaded it, any suggestions on what I
> could do to get it working?
The program downloads without the execute permission set. You need to set it yourself:
chmod u+x trans_demo
Then it should run.
Go for it. For this assignment I don't really care what clipping algorithm you use as long as it actually performs line clipping. (To remind people, clipping occurs when you recalculate the end points of a line and then use these new endpoints to draw the line.)
One other clarification that I realized I left out of the assignment: I expect the polygon to be closed when clipped. For example, if a corner of the cube is cut off there should be a triangle connecting the three clipped edges at the point of clipping.
Another clarification: you are not required to draw the clipping box/frustum for this assignment. However, I recommend you include this ability as it can be useful for debugging purposes.