Project 3 : Animation - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Project 3 : Animation

Description:

Standard subdivision curve ... Subdivision curve. You should also add one UI control for users to change the # of subdivision ... Subdivision Surface ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 36
Provided by: cse2
Category:

less

Transcript and Presenter's Notes

Title: Project 3 : Animation


1
Project 3 Animation
this ppt is at http//www.cse.ust.hk/weiwei/com
p341/lab_2.ppt
Tutorial II (TA Weiwei)
2
Overview
  • Project requirements
  • Implementation details
  • Simple bells and whistles

3
Basic Requirements
  • Three curves with wrapping supports
  • Bezier (C0 continuity between segments)
  • B-spline
  • Catmull-Rom
  • Particle system
  • At least two types of forces (gravityanother)
  • Baking
  • Animation of proj. 1 model (for the artifacts)

4
Curve Maths
  • Bezier curve
  • http//en.wikipedia.org/wiki/BC3A9zier_curve
  • http//www.cs.unc.edu/mantlter/research/bezier/
  • B-Spline
  • http//en.wikipedia.org/wiki/B-spline
  • http//www.engin.umd.umich.edu/CIS/course.des/cis5
    77/projects/BSP/welcome.html
  • Catmull-Rom curve
  • http//www.mvps.org/directx/articles/catmull/

5
Implementing Bezier(1)
  • Compute a Bezier segment for every four
    consecutive control points (ctrl-pts)
  • Except for the last end point of previous
    segment, previous ctrl-pts will not be reused
  • Add two horizontal lines to the start/end points
    of the curve
  • If the number of ctrl-pts is not enough to form
    Bezier segment, draw linear segments (one or two)
    instead

6
Implementing Bezier(2)
  • Example (3K1 ctrl-pts can form k segments)
  • 7 ctrl-pts 2 Bezier segments 2 horizontal
    lines
  • 8 ctrl-pts 2 Bezier segments 2 horizontal
    lines 1 line segment
  • 9 ctrl-pts 2 Bezier segments 2 horizontal
    lines 2 line segment
  • 10 ctrl-pts 3 Bezier segments 2 horizontal
    lines
  • Please try them out with the sample program

7
Bezier Wrapping (1)
  • Wrapping the curve has C0 continuity between the
    end and the beginning of the curve
  • (3K1 ctrl-pts can form k segments)
  • When of ctrl-pts is mutiple of 3
  • Copy the first ctrl-pt to the end of curve with x
    x0T
  • Copy the last 3 ctrl-pts to the beginning of the
    curve with x xn-2-T, xn-1-T, xn-T respectively

8
Bezier Wrapping (2)
  • When of ctrl-pts is NOT multiple of 3
  • Just follow the same approach used in linear curve

9
Implementing B-Spline(1)
  • Compute a B-Spline segment for every 4
    consecutive ctrl-pts
  • BUT the last 3 ctrl-pts of the previous segment
    is reused again
  • K ctrl-pts can form (k-3) segments
  • Please see lecture note 14, P26

3 segments
10
Implementing B-Spline(2)
  • Add two line segments to complete the curve

3 segments
or
3 segments
11
B-Spline Wrapping
  • Copy the first 3 ctrl-pts to the end
  • with x x0T, x1T, x2T respectively
  • Copy the last 3 ctrl-pts to the beginning
  • with x xn-3-T, xn-2-T, xn-1-T respectively

12
Implementing Catmull-Rom
  • Same as B-Spline (Please see lecture note 14)
  • BUT, no convex hull property (the system
    algorithm requires x increases monotonically)
  • Possible solution return the eval-pts only if
    the x-value of current eval-pt is grater the
    x-values of previous eval-ps

remove bad points
With bad eval-pts, you will get wrong
interpolated curves!
13
Implementing PSystem(1)
  • Implement all funcs in ParticleSystem.cpp!
  • computeForcesAndUpdateParticles()
  • drawParticles()
  • are called by ModelerView (not under your
    control) in every time step, no matter simulate
    is ON or not. So you should check it at the
    beginning of these two functions
  • bakeParticles()
  • use it to store ALL the particle positions at
    given time t
  • called in computeForcesAndUpdateParticles()

14
Implementing PSystem(2)
  • drawParticles()
  • Draw All the particles at time t. Depends on
    simulate, you need to reload the baked
    positions or use the current positions to draw
    the particles.
  • DONT use to check if time equals to the
    time of the baked frame!
  • Instead, you need to check if t is within a time
    interval framei.time, framei1.time

15
Bells Whistles
16
Curve Enhancement
  • At most THREE whistles from following (each of
    them one whistle)
  • Control the tension of Catmul-Rom Spline
  • Higher degree polynomial curve
  • Standard subdivision curve
  • Control on the derivatives at end points of the
    C2 interpolating curve
  • C1 continuity of Bezeir curve
  • Dummy control control points

17
Curve Enhancement (1)
  • Control the tension of the Catmull-Rom Spline

Tension 0.5
a loop
Tension 2.0
Loop handling is required
18
Curve Enhancement (2)
  • Higher degree polynomial splines
  • Only need for one type of curve and any degree
    higher than basic requirement
  • For example Bezier curve is a good choice
  • Generalized Bezier Curve
  • Let n 4 or 5...(bigger than 3)

19
Curve Enhancement (3)
  • Subdivision curve
  • You should also add one UI control for users to
    change the of subdivision

DLG (sub-divided once)
DLG (sub-divided 3 times)
20
Curve Enhancement(4)
  • Control on the derivatives at end points of the
    C2 interpolating curve
  • Add options to the UI to enforce C0 or C1
    continuity between Bezier curve segments

21
Curve Enhancement (5)
  • Dummy control points
  • Add the ability to add new control points to ANY
    curve types without changing the curve shape at
    all
  • Please draw in different colors

22
Adaptive Bezier Curve
  • Use De Casteljaus algorithm
  • P18,Lecture 14
  • Subdivide the curve more when the curvature is
    greater than some threshold

with De Castaljau
without De Castaljau
23
Spring System
  • Implement the following system
  • See P23, Lecture 13
  • At least 4 springs is required for this bell
  • Upgrade to 2 bells if you extend it to a
    spring-based cloth

( )
24
Runge-Kutta method
  • Implement Runge-Kutta technique
  • See http//web.mit.edu/10.001/Web/Course_Notes/D
    ifferential_Equations_Notes/node5.html

4th Order Runge-Kutta Method
25
Collision Bouncing
  • Allow for particles to bounce off each other by
    detecting collisions when updating their
    positions and velocities
  • All particles should all participate

26
Arbitrary Averaging Mask
  • Allow users to specify an arbitrary averaging
    mask
  • P 64, Lecture 14
  • Use a list of textbox (Modify the UI) to stroe
    the averaging mask

27
GUI Improvement
  • Any change you like to do with the interface
  • E.g. Adding a control button to show the the
    original shape of an interpolating curve
  • Credit varies with the quality of the improvement

28
C2 Interpolating Curve
  • Refer to http//www-csl.csres.utexas.edu/billmar
    k/teach/cs384g-07-fall/lectures/lecture14-c2interp
    -annotated.pdf

29
Editing Catmul-Rom
  • Adjust the tangent/tension of the curve segment
    by using some small handles

30
GL-Picking
  • Use selection buffer in OpenGL
  • Achieve a ID for each component for the model
  • Render the model to selection buffer
  • Get the ID from the buffer
  • Select the corresponding curve

31
Implementing Quaternions
  • Gimbal lock
  • Please see http//www.anticz.com/eularqua.htm
  • Quaternion
  • Please see http//www.gamedev.net/reference/artic
    les/article1095.asp

32
Other Bells
  • If you are interested and have time
  • Motion warping
  • Rigid-body simulation of your model
  • E.g. the arm will not pass through the body
  • Subdivision Surface
  • Need a structure to store the faces and vertices
    (you are required to implement it by your self)
  • Inverse kinematics
  • As long as you havent done it in Proj. 1

33
Extra Bells
  • You can add any interesting graphics related
    features you can think of to this project
  • For example
  • Tensor product surface (P50 L14)
  • Free form deformation (3 bells)
  • http//web.cs.wpi.edu/matt/course/cs563/talksfree
    form/free_form.html
  • http//www.cs.unc.edu/geom/ffd/

34
Grade Sheet
  • http//www.cse.ust.hk/weiwei/comp341/gradesheet.d
    oc

35
this ppt is at http//www.cse.ust.hk/weiwei/com
p341/lab_2.ppt
Write a Comment
User Comments (0)
About PowerShow.com