Академический Документы
Профессиональный Документы
Культура Документы
to Kigali institute of Science and Technology, KIST in partial fulfillment of the requirements for the award of the degree in Bachelor of Science in Computer Engineering and Information Technology, BSCEIT is our own and the appropriate credit has been given where reference has been made to the work of others. We further declare that the work reported in this project has not and will not be for the award of any submitted, for the award of any other degree or diploma in this Institute or any other institute or university in Rwanda.
Signed by
..
KIGALI INSTITUTE OF SCIENCE AND TECHNOLOGY INSTITUT DES SCIENCES ET DE TECHNOLOGIE DE KIGALI
FACULTY OF ENGENEERING
CERTIFICATE This is to certify that the Project Work entitled 3D SOLID GRAPHICS USING BEZIER CURVE AND THEIR APPLICATIONS is a record of the original work done by UWABYAYE Clementine (REG.NO:GS20050713)and UWAMAHORO
Marie Claire(REG.No: GS20050714) in partial fulfillment of the requirement for the award of Bachelor of Science Degree in information Technology of Kigali Institute of Science and Technology (KIST) during the Academic Year 2009.
.. (Dr. GAURAV Bajpai) Supervisor MWAKIJELE Jonathan HEAD, Dept. of CEIT
DEDICATION
To the Almighty God our Guide To my beloved mother MUKESHIMANA Spciose To all members of my family. To my beloved daughter IHORERE Lina Tania.
UWABYAYE Clmentine
To the Almighty God our Guide To my beloved husband BISANGWA Modeste To my beloved first born CYUZUZO Lisa Chanelle To my beloved mother MukaBucyana Asterie To my beloved Sisters To my family and family- in-law
iii
ACKNOWLEDGEMENTS
We acknowledge that what we have achieved was through the help of almighty God Who gave us the strength, courage and determination to carry out our responsibilities. We also thank our supervisor Dr.GAURAV Bajpai for all his help, feedback, time, patience and assistance in this project. We would like to thank our parents for giving us a birth, for their education, help, and assistance since our infancy. We would like to thank the following families for their help during this project. Family of MURENGERANTWALI Mathias, family of MUDAHERANWA Norbert and Family of Ntirushwa J.Baptiste. Thanks to all student of IT for their advices about how to tackle the project and warnings of some of the pitfalls to avoid. Thanks to those who gave up their time to be a part of the project; It was truly appreciated. Finally yet important, we greatly appreciate our friends, neighbors and colleagues for their moral and material support that highly contributed to our success.
iv
ABSTRACT 3D solid graphics using Bezier curve is a project which covers a range of techniques. The literature contains works of how Bezier curve are used in creating 3D solid and providing its smoothness. Three dimensional solid graphics are widely used in various applications. The project contains full explanation of Bezier curve as the main element of the project; including algorithm used to draw this curve. Java netbeans IDE and JDK 6U12 will be introduced to draw different position, of Bezier curve. The reason of choosing java programming language as a favored language will be also included in this project Finally, different applications of created 3D solid in different areas will be discussed.
TABLE OF CONTENTS
DECLARATION.................................................................................................................................. i C E R T I F I C A T E ......................................................................................................................... ii ACKNOWLEDGEMENTS ............................................................................................................... iv ABSTRACT ........................................................................................................................................ v TABLE OF CONTENTS ................................................................................................................... vi LIST OF ABBREVIATION ............................................................................................................ viii CHAPTER 1: BACKGROUND ......................................................................................................... 1 1.1 Overview of the project ............................................................................................................. 1 1.2 Introduction ............................................................................................................................... 1 1.2.1 History of Bezier curve ...................................................................................................... 2 1.2.2 Properties of Bezier curve .................................................................................................. 3 1.2.3. Java .................................................................................................................................... 4 1.2.4 Problem statement .............................................................................................................. 8 1.2.5 Aims of the project ............................................................................................................. 8 1.2.6 Objectives of the project..................................................................................................... 8 1.2.7 Project scope....................................................................................................................... 9 1.3 Methodology ............................................................................................................................. 9 CHAPTER 2: LITERATURE REVIEW .......................................................................................... 10 2.1 Introduction ............................................................................................................................. 10 2.1.1 A solid .............................................................................................................................. 10 2.1.2 Bezier curve ...................................................................................................................... 10 2.1.3 Java 3D ............................................................................................................................. 10 2.1.4 3D graphics....................................................................................................................... 11 CHAPTER 3: ANALYSIS AND IMPLEMENTATION ................................................................. 12 3.1 Overview ................................................................................................................................. 12 3.2 Analysis ................................................................................................................................... 12 3.2.1 Constructive Bezier Curve Algorithm .............................................................................. 13 3.2.2 Basic Algorithm ............................................................................................................... 13 3.2.3 Special & General Cases .................................................................................................. 14 3.2.4 Parametric equation of degree n ....................................................................................... 16 3.2.4 Analyzing the Bezier curve By Fourier series.................................................................. 17 3.3 Implementation ........................................................................................................................ 21 3.3.1 Drawing a Bezier curve .................................................................................................... 22 3.3.2 Bezier curve transformation ............................................................................................. 24 CHAPTER 4 APPLICATION OF 3D SOLID GRAPHICS ............................................................. 26 4.1.1 Three-Dimensional graphics in Radiotherapy .................................................................. 26 4.1.2 Three-dimensional solid graphics in Biomechanics ......................................................... 27 4.2 Three-dimensional solid graphics in multimedia .................................................................... 28 4.3 Three dimensional solid graphics in Graphical User Interface (GUI) .................................... 29 4.5 Three-dimensional solid graphics in Business graphics and presentation .............................. 29 4.6 Three-dimensional solid graphics in Computer Aided design (CAD) .................................... 30 CHAPTER 5 CONCLUSION AND FUTURE WORK.................................................................... 31 5.1 Conclusion ............................................................................................................................... 31 5.2 extension and future work ....................................................................................................... 31 5.2.1 Improvements ................................................................................................................... 31 5.2.2 Extensions ........................................................................................................................ 31 REFERENCES AND BIBLIOGRAPHY ......................................................................................... 32 vi
LIST OF FIGURES Figure1: Steps for creating and running a java program5 Figure2: Bytecode6 Figure3 : Java running environment22 Figure4: Linear Bezier curve23 Figure5: Quadratic Bezier curve23 Figure6: Cubic Bezier curve..24 Figure7: Closed Bezier curve.24
vii
LIST OF ABBREVIATION API AWT CAD CD CE&IT CT Dr DVD GUI HOD IDE IT JDK-6u12 JVM MR PDA ROM TV VCR WYSIWYG ZUI 3D Application Programmers Interface Abstract Window Toolkit. Computer Aided Design. Compact Disk. Computer Engineering and Information Technology. Computed Tomography. Doctor. Digital Video Disk. Graphical User Interface. Head of department. Integrated Development Environment. Information Technology. Java Development tool Kit module six update to12 in Windows Platform. Java Virtual Machine. Magnetic Resonance. Personal Data Assistants Read Only Memory. Television. Videocassette Recorder. What You See, Is What You Get. zooming user Interface. Three Dimension.
viii
CHAPTER 1: BACKGROUND
This chapter begins with an overview of the project followed by a brief introduction to the topic, including the history of Bezier curve. The selected task which were to be completed are briefly explained. 1.1 Overview of the project The project was designed to generate 3D solid graphics with the help of Bezier curve using java programming language. An analysis of different method which could be employed to produce the final shape within the time frame was undertaken. 1.2 Introduction Three dimensional graphics is a part of computer graphics concerned with generating and displaying three-dimensional objects in a two-dimensional space. Computer graphics is one of attractive and rapidly developing fields of information technology. Its popularity is closely connected to the development of computers and their availability to the wider public. The basis of today's communication of computer users is interaction based on the idea What You See, Is What You Get? (WYSIWYG). Such communication contributes to advancing the relationship of a software product or application with its user.
3D graphics allow object (solid) to be created on a X-Y-Z scale (width, height, depth ). As 3D entities ,they can be rotated& viewed from all angles as well as be scaled larger or smaller, moved from one position to another position parallel and sheared. This means that a solid will be created, displayed and manipulated in the computer in three dimensions from 2D Bezier curve. This language will not only allow us to create 3D solid graphics but also to edit the created graphics.
1
We will first make a java code to draw the basic element of computer graphics called Bezier curve which provide the smoothness of the body, after creating it we shall use other codes to move it from position 1 to position 2 . there we will be having a 3D solid graphic and try to look out of the reason of creating this shape, why is it needed, in brief what is their applications? 1.2.1 History of Bezier curve Bezier curve was developed by the French mathematician and Engineer Pierre Bezier in the late 1960s while working for the car manufacturer Renault for use in the design of Renault automobile bodies. Pierre Bezier was looking for a way to describe a curve with mathematical precision that would enable it to be scaled and copied without loss of accuracy. Although he used a 3D form of the curve to Specify a solid car body model; its the 2D version that has become the mainstay of Computer graphics applications. Bezier curves have a number of properties that make them highly useful and convenient for curve and surface design. They are also easy to implement. For these reasons, Bezier curve are widely available in various CAD (Computer Aided design) software, in general graphics packages (such as GL on Silicon Graphics systems), and in assorted drawing and painting packages(such as Aldus Superpaint and Cricket Draw).[1]
The method by which Bezier developed these curves is relatively simple. He began by defining a curve contained within a cube. This curve was given by a parametric equation equal to y=x2 And then by transforming the cube into any kind of parallelepiped, naturally the curve changes shape. In other words the shape of the resulting
parallelepiped determines the shape of the parametric curve. The four control points are the vertices of an imaginary parallelepiped. Bezier used the four vertices to describe the shift of the parallelepiped and therefore the shape of the resulting curve. Because the
2
curve is always within this imaginary parallelepiped, it can be said that the curve is contained completely within the convex hull of its control points. (The control points are the vertices that define the parallelepiped.)[1] 1.2.2 Properties of Bezier curve 1.2.2.1 A very useful property of a Bezier curve is that it always passes through the first and last control points. In general it will not pass through any other control points, but its shape mimics that one of the control polygon. Thus, the slope at the beginning of the curve is along the line joining the first two control points, and the slope at the end of the curve is along the line joining the last two endpoints. 1.2.2.2 Another important property of any Bezier curve is that it lies within the convex hull (convex polygon boundary) of the control points. This follows from the properties of Bezier blending functions: They are all positive and their sum is always equal to 1.
i= 0
i,n
(t )P i = 1
(1 )
1.2.2.3 Bezier curve have another important property that the tangent to the curve at an endpoint is along the line joining that endpoint to the adjacent control point. 1.2.2.4 Adjusting the position of a control point changes the shape of the curve in a predictable manner. This means that the curve follows the control points. 1.2.2.5 Bezier curve is defined on n+1 points P0,Pn and can be represented as a polynomial curve of degree n. 1.2.2.6 Adding multiple control points at a single position in space will add more weight
3
to that point pulling the Bezier curve towards it. 1.2.2.7 Closed curves can be generated by making the last control point the same as the first control point. First order continuity can be achieved by ensuring the tangent between the first two points and the last two points are the same. 1.2.2.8 The blending function is always a polynomial one degree less than the number of control points. Thus 3 control points results in a parabola, 4 control points a cubic curve etc. 1.2.3. Java
The term Java actual refers to more than just a particular language like C or Pascal. Java encompasses several parts, including :