+ All Categories
Home > Documents > Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing...

Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing...

Date post: 05-Jan-2016
Category:
Upload: charla-wade
View: 212 times
Download: 0 times
Share this document with a friend
Popular Tags:
16
Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009
Transcript
Page 1: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Constructing Bezier Curves on the Surface of a Sphere

By Reza Ali Fundamentals of Spatial Computing

UCSB MAT 594CM Spring 2009

Page 2: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Presentation Outline

• Purpose/Goal• Spherical Coordinates & Properties• SLERP (spherical linear interpolation)• OpenGL Bezier Curves• Particle Systems• Voronoi & Shaders

Page 3: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Purpose/Goal

• Partition the surface of a sphere using the voronoi algorithm

• Allow the points that define the voronoi to be an interactive magnetic particle system

• Real Time manipulate of particles

Page 4: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Spherical Voronoi

Page 5: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Spherical Coordinates

• Sphere Equations:

• Cartesian Equivalents: €

r = x 2 + y 2 + z2

ϕ = tan−1 y / x( )

θ = cos−1 z

x 2 + y 2 + z2

⎝ ⎜ ⎜

⎠ ⎟ ⎟

x = r ⋅cos ϕ( ) ⋅sin θ( )

y = r ⋅sin ϕ( ) ⋅cos θ( )

z = r ⋅cos θ( )

0 ≤ ϕ ≤ 2π and 0 ≤ θ ≤ π( )

Page 6: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Sphere Properties

• Equation of a sphere– Cartesian Coordinates:

– Spherical Coordinates:

• 2 values define a sphere– Center & Radius

• Geodesic: curve that is the shortest distance between two points

x 2 + y 2 + z2 = r2

r 0 ≤ ϕ ≤ 2π and 0 ≤ θ ≤ π( )

Page 7: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Sphere Properties

• Antipodal: points are located directly opposite of each other on a sphere (no geodesic)

• Great Circle: the intersection of a plane containing the origin and the unit sphere

Page 8: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Spherical Linear Interpolation

• A method of interpolating between two points on a sphere

• Estimation:

• Not good enough this will traverse the geodesic at non-constant rate €

1− Ω( )p0 + Ωp1

1− Ω( )p0 + Ωp1

Page 9: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Spherical Linear Interpolation

• Z=slerp(x,y,α) (constant rate)

• Watch for the case Ω=180° (antipodal case)

• Related to Quaternion €

p = p1 − cosΩ( ) ⋅ p0

p = p1 − p1 • p0( ) ⋅ p0

p = slerp p0, p1,α( ), θ =αΩ

p =sin 1−α( )Ω( )

sin Ω( )

⎣ ⎢ ⎢

⎦ ⎥ ⎥p0 +

sin αΩ( )sin Ω( )

⎣ ⎢

⎦ ⎥p1

Page 10: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Bezier Curves

• Develop a set of parametric cubic equations to represent curves and surfaces using only a small set of control points (4)

Q t( ) = x t( ),y t( ),z t( )( )

x t( ) = axt3 + bxt

2 + cxt + dx

y t( ) = ayt3 + byt

2 + cyt + dy

z t( ) = azt3 + bzt

2 + czt + dz

Page 11: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Bezier Curves & OpenGL

• OpenGL evaluator functions allow you to use polynomial equations to produce vertices, normals, textures coordinates, and colors

• Evaluator functions define a Bezier Curve (also the basis for NURBS)

Page 12: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Bezier Curves & OpenGL

• Function: glMap1f()• Data Glfloat ctlpts[4][3]• glMap1f(

• target type• Lower t range• Higher t range • Stride • Number of points• Reference to points)

• glEnable(GL_MAP1_VERTEX_3)• glMapGrid1d(20,0,1)• glEvaMesh1(GL_LINE,0,20)• t=(0,1/20,2/20,…1)• 20 = number of points to evaluate

Page 13: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Particle Systems

• Developing 3D Particle System

• The particles will distribute themselves along the surface of a sphere

• Electromagnetic repulsion

• Voronoi Pattern Creation based of particle system

Page 14: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Voronoi & Shaders

• Create a voronoi curves that will define a sphere and use these curves as points where light escapes like ->

• Allow user to interactive with system via GUI (GLV)

• Real Time, maybe?

Page 15: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

Inspiration

Page 16: Constructing Bezier Curves on the Surface of a Sphere By Reza Ali Fundamentals of Spatial Computing UCSB MAT 594CM Spring 2009.

References

• Principles of Computer Graphics (Shalini Govil-Pai)• 3D Computer Graphics (Samuel R. Buss)• Wikipedia: Spherical Coordinates• Wikipedia: Sphere• Google Image Search • Efficient Reconstruction of Functions on the Sphere from Scattered Data

(Keiner, Kunis, Potts)• Vimeo: Mass_Ins• Spherical Centroid Voronoi Tesselation• Distributing Points on a Sphere • Voronoi Diagram on the sphere• Voronoi Diagram of Curves Objects• Voronoi diagrams on the sphere (Na, Lee, Cheong)


Recommended