SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
Computer Graphics January 12,2007
1
Report of 3D curve project
Chunhui Chen Mat. 123721
Email: njucch@hotmail.com
University of Trento, Department of Computer Science
Abstract
Java3D is an Application Programming Interface used for writing 3D graphics applications and
applets. This paper gives a short introduction of java3D, analyses the mathematics of Hermite,
Bezier, FourPoints, B-Splines curve, and describes implementation of curve creation and curve
operations using Java3D API.
Keywords:
Java3D, curve, Hermite, Bezier, FourPoints, B-Splines
1. Java3D Introduction
The Java 3D API is an interface for writing programs to display and interact with
three-dimensional graphics. The API provides a collection of high-level constructs for creating
and manipulating 3D geometry and structures for rendering that geometry. Java 3D provides the
functions for creation of imagery, visualizations, animations, and interactive 3D graphics
application programs.
A Java 3D application builds and manipulates a scene graph by constructing Java 3D objects and
then later modifying those objects by using their methods. A Java 3D program first constructs a
scene graph, once built, hands that scene graph to Java 3D for processing. The structure of a scene
graph is Directed Acyclic Graph (DAG), parent-child relationship, and tree structure with root,
branch and leaf.
Computer Graphics January 12,2007
2
2. Curve Mathematics
All curve design is concerned with the creation of smooth curves based on a small number of
user-controlled parameters. It is common that the curve has two endpoints and other controls to
vary the shape of the curve. Cubic polynomials are very popular in curve design.
Complex curves are often created segment-by-segment, using simpler curves for each segment.
Therefore, the complete curve is determined by each segment and the continuity conditions at
each join point.
Geometric Continuity:
G0: Curves are joined
G1: First derivatives are proportional at the join point. The curve tangents have the same
direction, but not necessarily the same magnitude.
G2: First and second derivatives are proportional at the join point.
Parametric Continuity:
C0: Curves are joined.
C1: First derivatives are equal.
C2: First and second derivatives are equal.
Cn: The nth derivatives are equal.
Many curve are defined on a parameter t. Instead of the function y=f(x), the curve is defined as
x=f(t), y=g(t), z=s(t), tε[0,1]. One popular method is to describe the curve as a matrix equation
involving a basis matrix M, a geometry vector g, and a polynomial vector p.
The general form for a parametric curve can be written as:
Mgpt t
k=)(θ
The blending function is represented by Mpt
k , which give the curve its unique shape. The basis
matrix M determines the coefficients of the blending function. The geometric constraints are
multiplied by blending function. It is common thus to differentiate different types of curves based
on geometric constraints and the basis matrix.
Hermite Curves
Hermite curves are a foundation of interactive curve design. Commonly hermite curves are
designed by two control points and tangent segments at each control point. Tangent handles may
be interactively changed to adjust the shape of the curve once control points are placed. Hermite
curves are easy to implement but have a number of drawbacks. For instance, it is difficult to
determine how long to make a tangent handle in order to create a desired shape.
To calculate a Hermite curve, we need the following vectors:
Computer Graphics January 12,2007
3
0P : The startpoint of the curve
0T : The tangent vector at the first point (how the curve leaves the start point).
1P : The endpoint of the curve
1T : The tangent vector at the endpoint.
The geometric constraints can be written in the form,
t
TTPPg ],,,[ 1010=
Here we consider only x-component of the Hermite curve, as y and z components are the same.
Mgttttx )1,,,()( 23
=
The required equations are x (0), x (1), )0('
x , )1('
x
Mgx t
]1,0,0,0[)0( =
Mgx t
]1,1,1,1[)1( =
Since Mgtttx t
]0,1,2,3[)( 2'
=
Mgx t
]0,1,0,0[)0('
=
Mgx t
]0,1,2,3[)1('
=
Assume
t
xxxxg )]1(),0(),1(),0([ ''*
= ,
**
0123
0100
1111
1000
Mgg
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
=
Calculate inversion of matrix, we can get M as:
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
−−−
−
=
0001
0100
1233
1122
M
This yields blending function as:
132)( 23
1 +−= tttb
Computer Graphics January 12,2007
4
23
2 32)( tttb +−=
ttttb +−= 23
3 2)(
23
4 )( tttb −=
Thus,
14031201 )()()()()( TtbTtbPtbPtbt +++=θ
Drawing a single segment of a Hermite curve is relatively straightforward. A more complex shape
can be created with piecewise Hermite curve segments. It is necessary to decide the continuity at
the join point. In fact, it is not easy to construct desired shapes for a single segment as the tangent
handles have to be moved very far away from the control points to produce significant bends. It is
a drawback of Hermite curves. A possible method for this drawback is to weight the blending
functions for the tangent vector. Or it is possible to relax the need for tangent handles by
converting a Hermite curve into a cardinal spline.
Bezier Curve
As discussed above, using tangent handles to adjust the shape of curve is somewhat clumsy. The
difficulties increase when creating piecewise cubic Hermite curves. Compensating for these
drawbacks leads into Bezier curves.
Linear Bezier
Linear Bezier curve is obtained by linear interpolation between two control points 0P , 1P ;
10)1()( tPPtt +−=θ , ]1,0[∈t
Quadratic Bezier
Quadratic Bezier is obtained by deCasteljau algorithm as a linear interpolation between linear
interpolation between control points 0P , 1P , 2P .
Consider three control points, on the line segment 0P 1P , point
)1(
1P in the ratio (1-t): t. The
point
)1(
2P on the segment 1P 2P is at the same ratio. Then draw a line from
)1(
1P to
)1(
2P .
Locate the point )(tθ at the same ratio on that line segment. This is the point on the curve at the
specified value of t, ]1,0[∈t . As show below:
Computer Graphics January 12,2007
5
])1[(])1)[(1()1()( 2110
)1(
2
)1(
1 tPPtttPPtttPPtt +−++−−=+−=θ
2
2
10
2
)1(2)1()( PtPttPtt +−+−=θ
With Bezier curves, tangents are implicitly specified. The geometric constraints are the individual
control points. The blending functions are as below:
2
0 )1()( ttb −=
)1(2)(1 tttb −=
2
2 )( ttb =
These blending functions happen to be the second-order Bernstein polynomials. In fact, it can be
extended that higher-order Bezier curves use higher-order Bernstein polynomials as their blending
functions.
Bernstein polynomials is defined by
ini
ni tt
iin
n
tB −
−
−
= )1(
!)!(
!
)(,
Cubic Bezier
Bezier curves are described as one method for implicitly specifying tangents. The tangent is
simply the vector created from segments extending from the first and last points. Thus Bezier
curves are supposed to be an extension of Hermite Curve, suppose the implicit tangent in a Bezier
curve is related to Hermite tangent by a linear relationship.
Consider cubic curve with control points 0P , 1P , 2P , 3P . Implicit Bezier tangents as below:
)( 010 PPT −= α
)( 321 PPT −= α
Computer Graphics January 12,2007
6
Given a value of α , the geometric constraints of the Bezier curve can be specified in a manner
similar to Hermite curve. The value α is defined as 3 for cubic Bezier to maintain constant
velocity as t varies from 0 to 1.
Bezier constraints vector is
t
g ]PPPP[ 3210=
Hermite geometric constraints indicated as
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
==
3
2
1
0
1010h
33-00
0033-
1000
0001
]TTP[g
P
P
P
P
P t
We have known the basis matrix hM for Hermite curves.
gMgM bhh =
So the basis matrix of Bezier curves
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
=
0001
0033-
036-3
13-31-
bM
The blending functions of cubic Bezier curve
3
1 )1()( ttb −=
2
2 )1(3)( tttb −=
)1(3)( 2
3 tttb −=
3
4 )( ttb =
The blending functions are the same as third-order Bernstein polynomials.
Bezier curves of degree n
General expression
∑=
=
n
i
ini PtBt
0
, )()(θ , where
ini
ni tt
iin
n
tB −
−
−
= )1(
!)!(
!
)(,
FourPoints Curve
FourPoints curve passes each control point. We define geometric constraints as:
t
xxxxg )]1(),3/2(),3/1(),0([*
=
Computer Graphics January 12,2007
7
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
=
1111
12/34/98/27
11/31/91/27
0000
A
Thus we can get the basis matrix of FourPoints curve M as:
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
== −
0001
14.5-95.5-
4.5-1822.5-9
4.513.5-13.54.5-
1
AM
B-Splines Curve
Spline curves originate from flexible strips used to create smooth curves. They are formed
mathematically from piecewise approximations of cubic polynomial functions with zero, first and
second order continuity.
The problems with a single Bezier curve range from the need of a high degree curve to accurately
fit a complex shape. To overcome these problems, B-Splines curves are introduced.
B-Splines are one type of spline that are perhaps the most popular in computer graphics
applications. They have many advantages
Changes to a control point only affects the curve in that locality.
Any number of points can be added without increasing the degree of the polynomial.
Closed curves can be created by making the first and last points the same.
The equation for k-order B-Splines with n+1 control points kP are defined as follows:
∑=
+∈=
n
k
tkk vNPv
0
, 2]t-n[0,v)()(θ ,
where t is the degree, normally 3 or 4, as the degree increases the smoother the curve becomes.
Splines of degree 3 are by far the most commonly used in practice. N (v) are called blending
functions. The blending functions are defined as
⎩
⎨
⎧ ≤≤
= +
otherwise0
uif1
)( 1k
1,
k
k
uv
vN
)()()( 1,1
1
1,
1
, vN
uu
vu
vN
uu
uv
vN tk
ktk
tk
tk
ktk
k
tk −+
++
+
−
−+ −
−
+
−
−
=
ku is known as break points, also called knots on the curve. A knot vector )...,( 10 tnuuu + must
be specified. For a given v, only t basis functions are not zero, therefore B-Splines depends on t
Computer Graphics January 12,2007
8
nearest control points at any point v. The shapes of the blending functions are determined entirely
by the relative spacing between the knots. Scaling or translating the knot vector has no effect on
shapes of basis functions and B-Splines. There can be a number of possible options for the knot
positions. But more commonly the following function is used.
⎪
⎭
⎪
⎬
⎫
⎪
⎩
⎪
⎨
⎧
>+
≤≤+
<
=
nk2t-n
nkt1t-k
tk0
ku
3. Scene Graph Structure
Computer Graphics January 12,2007
9
4. Implementation Detail
User Interface (package gui)
Class Functionality
CurveMain Main class for running application
Scene Initiate control and editor components
TextOutputPanel Display functionality status
CurveCtrls Curve control panel
Curve Editor (package editor)
Class Functionality
CurveEditor Curve editor panel, create java3d canvas
CurveGroup Wrap curve, points, and control lines.
Curve operations.
DrawerBehavior Curve drawing and operations
Curve Geometry (package curve)
Class Functionality
Curve Abstract class for curve geometry
HermiteCurve Hermite curve implementation
BezierCurve Bezier curve implementation
FourPointCurve FourPoints curve implementation
BsplineCurve B-Splines curve implementation
Utility (package util)
Class Functionality
ControlPoint Create control point geometry
ControlPointCallback Callback for changing point position
CurveCallback Callback for operating curve
Plane Create plane geometry for projection
GeomUtil Curve geometry utility
View
Class Functionality
Land Create land lines geometry
Curve Creation
Curve creation is based on the part of “Curve Mathematics” discussed above and implemented by
java. You can see details of implementation in accessory java document.
Curve Operation
As follows describe some main curve operations:
Computer Graphics January 12,2007
10
Project point on plane
If the application is in plane mode, create a plane with mouse clicking. While drawing curve, if the
mouse picking result is instance of Plane, we can get intersection point position on plane.
Cut
As curve is created by indexed coordinates, we can find the nearest curve coordinates from
clicking position.
Hermite curve:
Find two nearest curve coordinates, and make them as new curve’s startpoint and tangent of
startpoint. With these two new points and the other two, we can redraw new Hermite curve.
Other curves:
Find the nearest curve coordinate and index. Keep the line from first coordinate to found
coordinate, and delete the other.
Mirror
Find two nearest curve coordinates. Calculate the linear equation by these two coordinates. Then
mirror all of curve coordinates with that linear equation. At last, redraw the curve.
Bounding
Get curve bounds and create a box branch group with the bounds. Change curve branch group to
be a child of box transform group. Then the curve group is included in box branch group and can
be translated with it.
Copy
Pick selected curve and get all the parameters of picked curve. Create a new curve with the
parameters.
Join
Select the first curve, get the endpoint and the tangent of endpoint.
Select the second curve, get the startpoint and the tangent of startpoint.
Create a new Hermite curve, which the startpoint’s position and tangent equals to the endpoint’s
position and tangent of the first curve, the endpoint’s position and tangent equals to the startpoint’s
position and tangent of the second curve. The continuity is C1.
Save
Pick selected curve and get all the parameters of picked curve. Build a DOM with the parameters.
At last create an XML file from DOM and save it. On the contrary, to load a saved curve, just
parse all of elements in the saved XML file to get parameters of curve, then draw a curve with the
parameters in the scene graph.
Computer Graphics January 12,2007
11
5. Conclusion
In conclusion, this report gives an introduction of Java 3D, the mathematics of four different
curves, and describes the scene graph structure and also implementation details of project.
Through this project, we can understand the mathematics of parametric curves very well. The
implementation of this 3D curve application is a good experiment for advance 3D graphical
programming. A few of works can proceed based on this project in future.
Finally, thanks to Professor Raffaele De Amicis and Professor Conti for their guidance and help
through out the project.
Appendix (Application snapshot)

Contenu connexe

Tendances

Curves wire frame modelling
Curves wire frame modellingCurves wire frame modelling
Curves wire frame modellingjntuhcej
 
Hermite bicubic-surface-patch
Hermite bicubic-surface-patchHermite bicubic-surface-patch
Hermite bicubic-surface-patchRohit Gothwal
 
Hermit curves &amp; beizer curves
Hermit curves &amp; beizer curvesHermit curves &amp; beizer curves
Hermit curves &amp; beizer curvesKKARUNKARTHIK
 
Synthetic curve
Synthetic curveSynthetic curve
Synthetic curveDhruv Shah
 
Unit 2 curves &amp; surfaces
Unit 2  curves &amp; surfacesUnit 2  curves &amp; surfaces
Unit 2 curves &amp; surfacesS.DHARANI KUMAR
 
B spline surfeces
B spline surfecesB spline surfeces
B spline surfecesramac123
 
Building 3D Morphable Models from 2D Images
Building 3D Morphable Models from 2D ImagesBuilding 3D Morphable Models from 2D Images
Building 3D Morphable Models from 2D ImagesShanglin Yang
 
An introduction to isogeometric analysis
An introduction to isogeometric analysisAn introduction to isogeometric analysis
An introduction to isogeometric analysisNguyen Vinh Phu
 
Surface representation
Surface representationSurface representation
Surface representationSunith Guraddi
 
Two Dimensional Shape and Texture Quantification - Medical Image Processing
Two Dimensional Shape and Texture Quantification - Medical Image ProcessingTwo Dimensional Shape and Texture Quantification - Medical Image Processing
Two Dimensional Shape and Texture Quantification - Medical Image ProcessingChamod Mune
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extractionRushin Shah
 
Synthetic surfaces
Synthetic surfaces Synthetic surfaces
Synthetic surfaces jntuhcej
 
UNIT 2- GEOMETRIC MODELLING
UNIT 2- GEOMETRIC MODELLINGUNIT 2- GEOMETRIC MODELLING
UNIT 2- GEOMETRIC MODELLINGTAMILMECHKIT
 
Vector-Valued Functions and GeoGebra
Vector-Valued Functions and GeoGebraVector-Valued Functions and GeoGebra
Vector-Valued Functions and GeoGebraIGMKD
 
Various types of surfaces 131044119001
Various types of surfaces 131044119001Various types of surfaces 131044119001
Various types of surfaces 131044119001rockrakos
 
Numerical disperison analysis of sympletic and adi scheme
Numerical disperison analysis of sympletic and adi schemeNumerical disperison analysis of sympletic and adi scheme
Numerical disperison analysis of sympletic and adi schemexingangahu
 
Coupling_of_IGA_plates_and_3D_FEM_domain
Coupling_of_IGA_plates_and_3D_FEM_domainCoupling_of_IGA_plates_and_3D_FEM_domain
Coupling_of_IGA_plates_and_3D_FEM_domainNguyen Vinh Phu
 

Tendances (20)

Curves wire frame modelling
Curves wire frame modellingCurves wire frame modelling
Curves wire frame modelling
 
Curve modeling
Curve modelingCurve modeling
Curve modeling
 
Hermite bicubic-surface-patch
Hermite bicubic-surface-patchHermite bicubic-surface-patch
Hermite bicubic-surface-patch
 
Hermit curves &amp; beizer curves
Hermit curves &amp; beizer curvesHermit curves &amp; beizer curves
Hermit curves &amp; beizer curves
 
Synthetic curve
Synthetic curveSynthetic curve
Synthetic curve
 
Curves and Surfaces
Curves and SurfacesCurves and Surfaces
Curves and Surfaces
 
Unit 2 curves &amp; surfaces
Unit 2  curves &amp; surfacesUnit 2  curves &amp; surfaces
Unit 2 curves &amp; surfaces
 
B spline surfeces
B spline surfecesB spline surfeces
B spline surfeces
 
Building 3D Morphable Models from 2D Images
Building 3D Morphable Models from 2D ImagesBuilding 3D Morphable Models from 2D Images
Building 3D Morphable Models from 2D Images
 
An introduction to isogeometric analysis
An introduction to isogeometric analysisAn introduction to isogeometric analysis
An introduction to isogeometric analysis
 
Surface representation
Surface representationSurface representation
Surface representation
 
Two Dimensional Shape and Texture Quantification - Medical Image Processing
Two Dimensional Shape and Texture Quantification - Medical Image ProcessingTwo Dimensional Shape and Texture Quantification - Medical Image Processing
Two Dimensional Shape and Texture Quantification - Medical Image Processing
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extraction
 
Synthetic surfaces
Synthetic surfaces Synthetic surfaces
Synthetic surfaces
 
UNIT 2- GEOMETRIC MODELLING
UNIT 2- GEOMETRIC MODELLINGUNIT 2- GEOMETRIC MODELLING
UNIT 2- GEOMETRIC MODELLING
 
Vector-Valued Functions and GeoGebra
Vector-Valued Functions and GeoGebraVector-Valued Functions and GeoGebra
Vector-Valued Functions and GeoGebra
 
Various types of surfaces 131044119001
Various types of surfaces 131044119001Various types of surfaces 131044119001
Various types of surfaces 131044119001
 
Bezier Curves
Bezier CurvesBezier Curves
Bezier Curves
 
Numerical disperison analysis of sympletic and adi scheme
Numerical disperison analysis of sympletic and adi schemeNumerical disperison analysis of sympletic and adi scheme
Numerical disperison analysis of sympletic and adi scheme
 
Coupling_of_IGA_plates_and_3D_FEM_domain
Coupling_of_IGA_plates_and_3D_FEM_domainCoupling_of_IGA_plates_and_3D_FEM_domain
Coupling_of_IGA_plates_and_3D_FEM_domain
 

En vedette

A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationgraphitech
 
Rescue Mission
Rescue MissionRescue Mission
Rescue Missiongraphitech
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Librarygraphitech
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationgraphitech
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modificationgraphitech
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationgraphitech
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationgraphitech
 

En vedette (7)

A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 
Rescue Mission
Rescue MissionRescue Mission
Rescue Mission
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Library
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modification
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 

Similaire à 3D Curve Project

Approximating offset curves using B ´ ezier curves with high accuracy
Approximating offset curves using B ´ ezier curves with high accuracyApproximating offset curves using B ´ ezier curves with high accuracy
Approximating offset curves using B ´ ezier curves with high accuracyIJECEIAES
 
Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...
Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...
Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...Cemal Ardil
 
Performance bounds for unequally punctured
Performance bounds for unequally puncturedPerformance bounds for unequally punctured
Performance bounds for unequally puncturedeSAT Publishing House
 
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORKMETRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORKgraphhoc
 
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORKMETRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORKFransiskeran
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsKetan Jani
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsThirunavukarasu Mani
 
Problem Solving by Computer Finite Element Method
Problem Solving by Computer Finite Element MethodProblem Solving by Computer Finite Element Method
Problem Solving by Computer Finite Element MethodPeter Herbert
 
Perimetric Complexity of Binary Digital Images
Perimetric Complexity of Binary Digital ImagesPerimetric Complexity of Binary Digital Images
Perimetric Complexity of Binary Digital ImagesRSARANYADEVI
 
Performance bounds for unequally punctured terminated convolutional codes
Performance bounds for unequally punctured terminated convolutional codesPerformance bounds for unequally punctured terminated convolutional codes
Performance bounds for unequally punctured terminated convolutional codeseSAT Journals
 
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...Alexander Litvinenko
 
elementry-objects-CG give great effort on learning for exam
elementry-objects-CG give great effort on learning for examelementry-objects-CG give great effort on learning for exam
elementry-objects-CG give great effort on learning for examtigag49721
 
International journal of engineering and mathematical modelling vol2 no1_2015_1
International journal of engineering and mathematical modelling vol2 no1_2015_1International journal of engineering and mathematical modelling vol2 no1_2015_1
International journal of engineering and mathematical modelling vol2 no1_2015_1IJEMM
 

Similaire à 3D Curve Project (20)

Approximating offset curves using B ´ ezier curves with high accuracy
Approximating offset curves using B ´ ezier curves with high accuracyApproximating offset curves using B ´ ezier curves with high accuracy
Approximating offset curves using B ´ ezier curves with high accuracy
 
3 D Graphics
3 D Graphics3 D Graphics
3 D Graphics
 
Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...
Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...
Optimal straight-line-trajectory-generation-in-3 d-space-using-deviation-algo...
 
Performance bounds for unequally punctured
Performance bounds for unequally puncturedPerformance bounds for unequally punctured
Performance bounds for unequally punctured
 
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORKMETRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
 
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORKMETRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
METRIC DIMENSION AND UNCERTAINTY OF TRAVERSING ROBOTS IN A NETWORK
 
MATLABgraphPlotting.pptx
MATLABgraphPlotting.pptxMATLABgraphPlotting.pptx
MATLABgraphPlotting.pptx
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
 
paper
paperpaper
paper
 
Geometric model & curve
Geometric model & curveGeometric model & curve
Geometric model & curve
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Problem Solving by Computer Finite Element Method
Problem Solving by Computer Finite Element MethodProblem Solving by Computer Finite Element Method
Problem Solving by Computer Finite Element Method
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Perimetric Complexity of Binary Digital Images
Perimetric Complexity of Binary Digital ImagesPerimetric Complexity of Binary Digital Images
Perimetric Complexity of Binary Digital Images
 
Performance bounds for unequally punctured terminated convolutional codes
Performance bounds for unequally punctured terminated convolutional codesPerformance bounds for unequally punctured terminated convolutional codes
Performance bounds for unequally punctured terminated convolutional codes
 
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
 
elementry-objects-CG give great effort on learning for exam
elementry-objects-CG give great effort on learning for examelementry-objects-CG give great effort on learning for exam
elementry-objects-CG give great effort on learning for exam
 
Electrical Engineering Assignment Help
Electrical Engineering Assignment HelpElectrical Engineering Assignment Help
Electrical Engineering Assignment Help
 
International journal of engineering and mathematical modelling vol2 no1_2015_1
International journal of engineering and mathematical modelling vol2 no1_2015_1International journal of engineering and mathematical modelling vol2 no1_2015_1
International journal of engineering and mathematical modelling vol2 no1_2015_1
 

Plus de graphitech

Rescue Mission
Rescue MissionRescue Mission
Rescue Missiongraphitech
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainabilitygraphitech
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainabilitygraphitech
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screensgraphitech
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screensgraphitech
 
Graph Matching
Graph MatchingGraph Matching
Graph Matchinggraphitech
 
Shape Analysis
Shape AnalysisShape Analysis
Shape Analysisgraphitech
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Librarygraphitech
 
WebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World WindWebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World Windgraphitech
 
Street Builder
Street BuilderStreet Builder
Street Buildergraphitech
 
Street Builder
Street BuilderStreet Builder
Street Buildergraphitech
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Windgraphitech
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Windgraphitech
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modificationgraphitech
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Projectgraphitech
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Projectgraphitech
 
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...graphitech
 
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...graphitech
 

Plus de graphitech (20)

Rescue Mission
Rescue MissionRescue Mission
Rescue Mission
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainability
 
Mashup - Sustainability
Mashup - SustainabilityMashup - Sustainability
Mashup - Sustainability
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screens
 
Multiple Screens
Multiple ScreensMultiple Screens
Multiple Screens
 
Graph Matching
Graph MatchingGraph Matching
Graph Matching
 
Shape Analysis
Shape AnalysisShape Analysis
Shape Analysis
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Library
 
WebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World WindWebCams Mapping on Nasa World Wind
WebCams Mapping on Nasa World Wind
 
Street Builder
Street BuilderStreet Builder
Street Builder
 
Street Builder
Street BuilderStreet Builder
Street Builder
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Wind
 
Live Video in World Wind
Live Video in World WindLive Video in World Wind
Live Video in World Wind
 
Terrain Modification
Terrain ModificationTerrain Modification
Terrain Modification
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Project
 
YARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) ProjectYARCA (Yet Another Raycasting Application) Project
YARCA (Yet Another Raycasting Application) Project
 
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
 
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
Implementation of Hybrid Terrain Representation in Nasa WorldWind: Regular Gr...
 
Arcanoid 3D
Arcanoid 3DArcanoid 3D
Arcanoid 3D
 
Arcanoid 3D
Arcanoid 3DArcanoid 3D
Arcanoid 3D
 

Dernier

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

Dernier (20)

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 

3D Curve Project

  • 1. Computer Graphics January 12,2007 1 Report of 3D curve project Chunhui Chen Mat. 123721 Email: njucch@hotmail.com University of Trento, Department of Computer Science Abstract Java3D is an Application Programming Interface used for writing 3D graphics applications and applets. This paper gives a short introduction of java3D, analyses the mathematics of Hermite, Bezier, FourPoints, B-Splines curve, and describes implementation of curve creation and curve operations using Java3D API. Keywords: Java3D, curve, Hermite, Bezier, FourPoints, B-Splines 1. Java3D Introduction The Java 3D API is an interface for writing programs to display and interact with three-dimensional graphics. The API provides a collection of high-level constructs for creating and manipulating 3D geometry and structures for rendering that geometry. Java 3D provides the functions for creation of imagery, visualizations, animations, and interactive 3D graphics application programs. A Java 3D application builds and manipulates a scene graph by constructing Java 3D objects and then later modifying those objects by using their methods. A Java 3D program first constructs a scene graph, once built, hands that scene graph to Java 3D for processing. The structure of a scene graph is Directed Acyclic Graph (DAG), parent-child relationship, and tree structure with root, branch and leaf.
  • 2. Computer Graphics January 12,2007 2 2. Curve Mathematics All curve design is concerned with the creation of smooth curves based on a small number of user-controlled parameters. It is common that the curve has two endpoints and other controls to vary the shape of the curve. Cubic polynomials are very popular in curve design. Complex curves are often created segment-by-segment, using simpler curves for each segment. Therefore, the complete curve is determined by each segment and the continuity conditions at each join point. Geometric Continuity: G0: Curves are joined G1: First derivatives are proportional at the join point. The curve tangents have the same direction, but not necessarily the same magnitude. G2: First and second derivatives are proportional at the join point. Parametric Continuity: C0: Curves are joined. C1: First derivatives are equal. C2: First and second derivatives are equal. Cn: The nth derivatives are equal. Many curve are defined on a parameter t. Instead of the function y=f(x), the curve is defined as x=f(t), y=g(t), z=s(t), tε[0,1]. One popular method is to describe the curve as a matrix equation involving a basis matrix M, a geometry vector g, and a polynomial vector p. The general form for a parametric curve can be written as: Mgpt t k=)(θ The blending function is represented by Mpt k , which give the curve its unique shape. The basis matrix M determines the coefficients of the blending function. The geometric constraints are multiplied by blending function. It is common thus to differentiate different types of curves based on geometric constraints and the basis matrix. Hermite Curves Hermite curves are a foundation of interactive curve design. Commonly hermite curves are designed by two control points and tangent segments at each control point. Tangent handles may be interactively changed to adjust the shape of the curve once control points are placed. Hermite curves are easy to implement but have a number of drawbacks. For instance, it is difficult to determine how long to make a tangent handle in order to create a desired shape. To calculate a Hermite curve, we need the following vectors:
  • 3. Computer Graphics January 12,2007 3 0P : The startpoint of the curve 0T : The tangent vector at the first point (how the curve leaves the start point). 1P : The endpoint of the curve 1T : The tangent vector at the endpoint. The geometric constraints can be written in the form, t TTPPg ],,,[ 1010= Here we consider only x-component of the Hermite curve, as y and z components are the same. Mgttttx )1,,,()( 23 = The required equations are x (0), x (1), )0(' x , )1(' x Mgx t ]1,0,0,0[)0( = Mgx t ]1,1,1,1[)1( = Since Mgtttx t ]0,1,2,3[)( 2' = Mgx t ]0,1,0,0[)0(' = Mgx t ]0,1,2,3[)1(' = Assume t xxxxg )]1(),0(),1(),0([ ''* = , ** 0123 0100 1111 1000 Mgg ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = Calculate inversion of matrix, we can get M as: ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ −−− − = 0001 0100 1233 1122 M This yields blending function as: 132)( 23 1 +−= tttb
  • 4. Computer Graphics January 12,2007 4 23 2 32)( tttb +−= ttttb +−= 23 3 2)( 23 4 )( tttb −= Thus, 14031201 )()()()()( TtbTtbPtbPtbt +++=θ Drawing a single segment of a Hermite curve is relatively straightforward. A more complex shape can be created with piecewise Hermite curve segments. It is necessary to decide the continuity at the join point. In fact, it is not easy to construct desired shapes for a single segment as the tangent handles have to be moved very far away from the control points to produce significant bends. It is a drawback of Hermite curves. A possible method for this drawback is to weight the blending functions for the tangent vector. Or it is possible to relax the need for tangent handles by converting a Hermite curve into a cardinal spline. Bezier Curve As discussed above, using tangent handles to adjust the shape of curve is somewhat clumsy. The difficulties increase when creating piecewise cubic Hermite curves. Compensating for these drawbacks leads into Bezier curves. Linear Bezier Linear Bezier curve is obtained by linear interpolation between two control points 0P , 1P ; 10)1()( tPPtt +−=θ , ]1,0[∈t Quadratic Bezier Quadratic Bezier is obtained by deCasteljau algorithm as a linear interpolation between linear interpolation between control points 0P , 1P , 2P . Consider three control points, on the line segment 0P 1P , point )1( 1P in the ratio (1-t): t. The point )1( 2P on the segment 1P 2P is at the same ratio. Then draw a line from )1( 1P to )1( 2P . Locate the point )(tθ at the same ratio on that line segment. This is the point on the curve at the specified value of t, ]1,0[∈t . As show below:
  • 5. Computer Graphics January 12,2007 5 ])1[(])1)[(1()1()( 2110 )1( 2 )1( 1 tPPtttPPtttPPtt +−++−−=+−=θ 2 2 10 2 )1(2)1()( PtPttPtt +−+−=θ With Bezier curves, tangents are implicitly specified. The geometric constraints are the individual control points. The blending functions are as below: 2 0 )1()( ttb −= )1(2)(1 tttb −= 2 2 )( ttb = These blending functions happen to be the second-order Bernstein polynomials. In fact, it can be extended that higher-order Bezier curves use higher-order Bernstein polynomials as their blending functions. Bernstein polynomials is defined by ini ni tt iin n tB − − − = )1( !)!( ! )(, Cubic Bezier Bezier curves are described as one method for implicitly specifying tangents. The tangent is simply the vector created from segments extending from the first and last points. Thus Bezier curves are supposed to be an extension of Hermite Curve, suppose the implicit tangent in a Bezier curve is related to Hermite tangent by a linear relationship. Consider cubic curve with control points 0P , 1P , 2P , 3P . Implicit Bezier tangents as below: )( 010 PPT −= α )( 321 PPT −= α
  • 6. Computer Graphics January 12,2007 6 Given a value of α , the geometric constraints of the Bezier curve can be specified in a manner similar to Hermite curve. The value α is defined as 3 for cubic Bezier to maintain constant velocity as t varies from 0 to 1. Bezier constraints vector is t g ]PPPP[ 3210= Hermite geometric constraints indicated as ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ == 3 2 1 0 1010h 33-00 0033- 1000 0001 ]TTP[g P P P P P t We have known the basis matrix hM for Hermite curves. gMgM bhh = So the basis matrix of Bezier curves ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 0001 0033- 036-3 13-31- bM The blending functions of cubic Bezier curve 3 1 )1()( ttb −= 2 2 )1(3)( tttb −= )1(3)( 2 3 tttb −= 3 4 )( ttb = The blending functions are the same as third-order Bernstein polynomials. Bezier curves of degree n General expression ∑= = n i ini PtBt 0 , )()(θ , where ini ni tt iin n tB − − − = )1( !)!( ! )(, FourPoints Curve FourPoints curve passes each control point. We define geometric constraints as: t xxxxg )]1(),3/2(),3/1(),0([* =
  • 7. Computer Graphics January 12,2007 7 ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1111 12/34/98/27 11/31/91/27 0000 A Thus we can get the basis matrix of FourPoints curve M as: ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ == − 0001 14.5-95.5- 4.5-1822.5-9 4.513.5-13.54.5- 1 AM B-Splines Curve Spline curves originate from flexible strips used to create smooth curves. They are formed mathematically from piecewise approximations of cubic polynomial functions with zero, first and second order continuity. The problems with a single Bezier curve range from the need of a high degree curve to accurately fit a complex shape. To overcome these problems, B-Splines curves are introduced. B-Splines are one type of spline that are perhaps the most popular in computer graphics applications. They have many advantages Changes to a control point only affects the curve in that locality. Any number of points can be added without increasing the degree of the polynomial. Closed curves can be created by making the first and last points the same. The equation for k-order B-Splines with n+1 control points kP are defined as follows: ∑= +∈= n k tkk vNPv 0 , 2]t-n[0,v)()(θ , where t is the degree, normally 3 or 4, as the degree increases the smoother the curve becomes. Splines of degree 3 are by far the most commonly used in practice. N (v) are called blending functions. The blending functions are defined as ⎩ ⎨ ⎧ ≤≤ = + otherwise0 uif1 )( 1k 1, k k uv vN )()()( 1,1 1 1, 1 , vN uu vu vN uu uv vN tk ktk tk tk ktk k tk −+ ++ + − −+ − − + − − = ku is known as break points, also called knots on the curve. A knot vector )...,( 10 tnuuu + must be specified. For a given v, only t basis functions are not zero, therefore B-Splines depends on t
  • 8. Computer Graphics January 12,2007 8 nearest control points at any point v. The shapes of the blending functions are determined entirely by the relative spacing between the knots. Scaling or translating the knot vector has no effect on shapes of basis functions and B-Splines. There can be a number of possible options for the knot positions. But more commonly the following function is used. ⎪ ⎭ ⎪ ⎬ ⎫ ⎪ ⎩ ⎪ ⎨ ⎧ >+ ≤≤+ < = nk2t-n nkt1t-k tk0 ku 3. Scene Graph Structure
  • 9. Computer Graphics January 12,2007 9 4. Implementation Detail User Interface (package gui) Class Functionality CurveMain Main class for running application Scene Initiate control and editor components TextOutputPanel Display functionality status CurveCtrls Curve control panel Curve Editor (package editor) Class Functionality CurveEditor Curve editor panel, create java3d canvas CurveGroup Wrap curve, points, and control lines. Curve operations. DrawerBehavior Curve drawing and operations Curve Geometry (package curve) Class Functionality Curve Abstract class for curve geometry HermiteCurve Hermite curve implementation BezierCurve Bezier curve implementation FourPointCurve FourPoints curve implementation BsplineCurve B-Splines curve implementation Utility (package util) Class Functionality ControlPoint Create control point geometry ControlPointCallback Callback for changing point position CurveCallback Callback for operating curve Plane Create plane geometry for projection GeomUtil Curve geometry utility View Class Functionality Land Create land lines geometry Curve Creation Curve creation is based on the part of “Curve Mathematics” discussed above and implemented by java. You can see details of implementation in accessory java document. Curve Operation As follows describe some main curve operations:
  • 10. Computer Graphics January 12,2007 10 Project point on plane If the application is in plane mode, create a plane with mouse clicking. While drawing curve, if the mouse picking result is instance of Plane, we can get intersection point position on plane. Cut As curve is created by indexed coordinates, we can find the nearest curve coordinates from clicking position. Hermite curve: Find two nearest curve coordinates, and make them as new curve’s startpoint and tangent of startpoint. With these two new points and the other two, we can redraw new Hermite curve. Other curves: Find the nearest curve coordinate and index. Keep the line from first coordinate to found coordinate, and delete the other. Mirror Find two nearest curve coordinates. Calculate the linear equation by these two coordinates. Then mirror all of curve coordinates with that linear equation. At last, redraw the curve. Bounding Get curve bounds and create a box branch group with the bounds. Change curve branch group to be a child of box transform group. Then the curve group is included in box branch group and can be translated with it. Copy Pick selected curve and get all the parameters of picked curve. Create a new curve with the parameters. Join Select the first curve, get the endpoint and the tangent of endpoint. Select the second curve, get the startpoint and the tangent of startpoint. Create a new Hermite curve, which the startpoint’s position and tangent equals to the endpoint’s position and tangent of the first curve, the endpoint’s position and tangent equals to the startpoint’s position and tangent of the second curve. The continuity is C1. Save Pick selected curve and get all the parameters of picked curve. Build a DOM with the parameters. At last create an XML file from DOM and save it. On the contrary, to load a saved curve, just parse all of elements in the saved XML file to get parameters of curve, then draw a curve with the parameters in the scene graph.
  • 11. Computer Graphics January 12,2007 11 5. Conclusion In conclusion, this report gives an introduction of Java 3D, the mathematics of four different curves, and describes the scene graph structure and also implementation details of project. Through this project, we can understand the mathematics of parametric curves very well. The implementation of this 3D curve application is a good experiment for advance 3D graphical programming. A few of works can proceed based on this project in future. Finally, thanks to Professor Raffaele De Amicis and Professor Conti for their guidance and help through out the project. Appendix (Application snapshot)