Implement 4 computer graphics drawing or rendering algorithms.
Proj 1 is a simple program can use mouse to click on monitor, then draw 2D shapes, such as line, dot, circle , polygon. This proj only use OpenGL method, drawDot, to complete and implement midpoint draw line alg.
the program contain 4
modes, include:
d
: the initial mode is mode d, and you can switch to this mode by keyboard inputd
. Under this mode user can drawdot
.l
: User can switch to this mode by keyboard inputl
. Under this mode user can drawline
.p
: User can switch to this mode by keyboard inputp
. Under this mode user can drawpolygon
.o
: User can switch to this mode by keyboard inputo
. Under this mode user can drawcircle
.
left click the canvas, and the dot will be draw on the position mouse click.
left click the canvas for two times, the dot will be draw on canvas from the position first click to the second one.
left click the canvas for many times, the edge of polygon will be drawn. right click to complete the polygon drawing.
left click the canvas, and the cirlce will be drawn for the center is position mouse down, and the radius is the position mouse up to position mouse down.
pressed keyboard c
to use.
pressed keyboard r
to use.
pressed keyboard q
to use.
proj 2 implement 2D line and polygon drawing, pattern transformation, View Port, Clipping and execute the commands, include scale
, rotate
, translate
, square
, triangle
, view
, clearData
, clearScreen
. It will read .asc file as input.
Proj 3 is implement 3D line and line and polygon drawing, pattern transformation, View Port, Clipping, hidden surface removal and execute the commands, include scale
, rotate
, translate
, object
, observer
, viewport
, nobackfaces
, reset
. It will read .asc file as input.
Proj 4 is implement 3D line and line and polygon drawing, pattern transformation, View Port, Clipping, hidden surface removal, lighting & shading, polygon filling and execute the commands, include scale
, rotate
, translate
, object
, observer
, viewport
, nobackfaces
, reset
. It will read .asc file as input.
- install Visual Studio, and create new proj, and put data to
debug
folder, then run the code.