The document summarizes the projects completed by a student for their Principles of Computer Graphics course. It includes an intermediate project involving the development of graphics libraries and applications, and a final project involving curve generation and interpolation tools.
The intermediate project involved creating libraries for vectors, matrices, 2D and 3D geometry, curves, and physics. Applications using these libraries included a paint program, a panzer (tank) simulation, and an inclined plane demonstration.
The final project was a software that loads an image and allows generating curves over it using points from the mouse. It supports Hermite, Bezier, B-spline, and Lagrange curves. The program allows moving, selecting, and connecting points, and saves
A graphic library and an application for simple curve manipolation
1. Facoltà di Scienze Matematiche, Fisiche e Naturali Corso di Laurea Magistrale in Informatica Principles of Computer Graphics- Projects slides - Student: Umberto Di Staso 142685 Professor: Raffaele de Amicis 2009/2010
2. Context Study of the principles of Computer Graphics: basic knowledge, basic tools to develop computer graphics applications, mathematics in Computer Graphics Context and Objectives Objectives Create a set of softwares that includes the concepts that we have learned during the lessons.
13. Intermediate Project Intermediate project consists in providing a set of functionalities (a java library) used to generate simple JOGL applications in which we use them.
14. Intermediate Project Functionalities are divided in six categories: Vectors: this category contains all the operations about vectors, like the sum between two of them, normalization, dot product, cross product and distance. Matrices: this category contains all the operations about matrices, like product between two matrices, determinant up 4x4 matrix, check and calculation of the inverse given a matrix. 2D Geometry: this category contains all the operations about simple 2D geometry, like lines, squares, rectangles, triangles, polygons and circles. 3D Polygon Generation: it is the same as the category before, but in three dimensional space. Curves: this category contains all the curves we have seen during the course, like Bezier, Hermite, Hermitesplines and B-Splines. Physics: this category contains some operations about physics.
15. Intermediate Project I have created three different applications (based on a single java library) in which I have used all the functionalities that I have implemented. Paint: the first application contains all about 2D geometry, 3D polygon generation and curves. Obviously to do this, I have used also vectors and matrices. Panzer: the second application contains some functionalities about physics. Inclined plane: the last application contains the physics functionalities that I have never used in the previous applications.
16. Paint As we can see, users can draw figures belonging to three macro categories: 2D figures: Draw a simple line given 2 points. Draw a square given center and edge length. Draw an equilateral triangle given center and edge length. Draw a circle given 3 non-aligned points. Draw a polygon given center and number of edges, center and radius. Ability to center the figures. 3D polygon: Draw a cube given center and edge length. Draw regular pyramid given edge length. Draw cone given radius and height. Draw sphere given radius and center. Curves: Draw Hermite given p0, p1 and the 2 vectors. Draw Bezier given 4 control points. Draw Hermitespline given a set of points and 2 vectors. Draw BSpline given a set of points and the degree.
17. Panzer Key points: Panzer: little tank designed using a tree structure: each element that composes the panzer is drawn around the root point. In this way, I can move the tank simply by using a translation of the root point. Bullet: little polygon with 8-16 edges. Trajectory: trajectory of the bullet. This particular kind of parabola is calculated using the formula of parabolic motion of projectiles. World: set of segments that composes the impact surface. Informations: words that explain the angle of the gun, initial speed of the bullet, range of the shoot and finally, the max height of the bullet.
18. Collision Detection The core of this application is, obviously, the algorithm that tells us when a bullet impacts on a surface. To understand properly how this algorithm works, is surely useful to look at the image on the right. As we can see, the bullet is basically a little polygon with 8-16 edges. The number of edges influences the precision of our collision detection. The algorithm works in this way: For each radius (in red) of the bullet it checks if one of these intersects a component of the impact surface (in green).
19. Inclined Plane The application consists in a simple inclined surface with a corpus on it. Using the “Spacebar” we release the object and we can see how the physics phenomenon called “uniform acceleration” (it depends on the gravitational acceleration and the angle of the inclined plane) brings changes on the motion of the corpus.
21. Final Project The project consists in a software that uses the library developed in the Intermediate project to construct complex functionalities. The asked functionality requisites are: Load a picture in background. Generate different curves using points setted by the mouse. HermiteSpline, Bezier Spline, BSpline, Lagrange. In this way we can isolate the perimeter of the previous loaded picture. Move single points using the mouse drag property. Select multi points and move them together. Curves must be connected to each other. Save the composition of curves in a file. Load the composition of curves saved before. Load a point file ad interpolate the points using the available curves. In this way we can observe the differences generated when the same points are interpolated by different kind of curves Change in real time the kind of curve that interpolates a set of points.
22. Final Project - GUI As we can see in the image on the right, the software gives us a large set of choices used for different kinds of operations: Picture canvas Clear button Delete last point Move points Change curve Curve select Load image Load a blank image Restore default image: Load point file Load a curve Save curve Hide points over the screen