Project 3 : Animation COMP 341 - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Project 3 : Animation COMP 341

Description:

Hints: Curves(2) How to generate the evaluated points? ... Hints: Bezier Curve ... Hints: Particle System(3) ... – PowerPoint PPT presentation

Number of Views:117
Avg rating:3.0/5.0
Slides: 20
Provided by: cse2
Category:

less

Transcript and Presenter's Notes

Title: Project 3 : Animation COMP 341


1
Project 3 AnimationCOMP 341
this ppt is at http//www.cse.ust.hk/weiwei/com
p341/lab_1.ppt
Grading sheet is at http//www.cse.ust.hk/weiwe
i/comp341/gradesheet.doc
Help Session I (TA Weiwei)
2
Overview
  • Project requirements
  • Brief description
  • Further Explanation
  • Hints on the basic requirements

3
Requirements
  • Three curves with wrapping support
  • Bezier (C0 continuity between segments)
  • B-Spline
  • Catmull-Rom
  • Particle system
  • Gravity another force simulator
  • Baking (to cache frame information)
  • You can hook your PS to your own model
  • Animate your model in project 1 (For artifacts)

4
Terms Curves(1)
  • Draw a curve based on a set of given points
  • E.g. a cubic bezier curve needs 4 points
  • Parametric equations
  • E.g. cubic bezier curve
  • (t is the parameter, Ps are all vectors here)

5
Terms Curves(2)
  • More information about these curves
  • 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/

6
Terms Wrapping
  • The curve has C0 continuity (i.e. positional
    continuity) between the end and the beginning of
    the curve
  • Solve the popping effect if the animation is
    looping (we use curves to guide the animation,
    x-axis is time, and y-axis is position or angle)
  • Please study the line case given in the template
    (linecurveevaluator.cpp)

7
Terms Particle Baking
  • Cache the intermediate results of the particle
    system simulation to avoid re-computation
  • Info needs to be cached whatever info needed
    for re-generation of this frame
  • How to cache them in any ways you like

Baked region is automatically marked in the GUI
8
Hints Curves(1)
  • What you need to do
  • Given the control points (Ctrl pts), compute all
    the evaluated points (Eval pts)
  • Eval pts Just like a set of sampled points along
    the curve

9
Hints Curves(2)
  • How to generate the evaluated points?
  • Evaluator every curve has its own evaluator
  • Derived from class CurveEvaluator

10
Hints Curves(3)
  • More specifically Where should you write the
    code?

override this function
  • INPUT
  • control_points a sorted list of control points
  • animation_length the maximum x value of the
    defined curve
  • wrap_control_points the indicator about curve
    wrapping
  • OUTPUT
  • evaluated_curve_points a list of unsorted
    evaluated points
  • TIPS
  • dont forget to re-initialize the output
    parameter!

11
Hints Curves(3 cont.)
  • How to integrate your own evaluator classes into
    the existed code?
  • Search TODO in GraphWidget constructor
  • Modify following lines as you need

12
Hints Bezier Curve
  • Consecutive four control points generate a
    segments, C0 continuity between segments
  • Add two horizontal lines to the start / end pt of
    the curve
  • If the number of ctrl-pt is not enough to form a
    Bezier segment, draw a linear segment (one or
    two) instead.
  • E.g. 3K1 points generate K segment(s)2
    horizontal lines
  • E.g. 3K2 points generate K segment(s)2
    horizontal lines 1 line segment

C0 continuity
Segment 2
Segment 1
Straight line
13
Hints B-Spline
  • Special handling is required for the end points
  • B-Spline doesnt pass through any control point.
  • NOTE This is NOT the basic requirement. But you
    still should add start/end point to form a
    complete curve in some ways (curve or straight
    line, it is up to you)
  • In the sample, the first/last endpoint is mapped
    to the first/last control point.

Sample exe
Normal B-Spline
14
Hints Catmull-Rom
  • Special handling is required for the convex hull
    problem
  • The evaluated points may not monotonically
    increase in X)
  • One possible solution is to abandon those turning
    back points

remove turning back evaluated points
15
Hints Particle System(1)
  • Your Tasks (by searching TODO)
  • Implement all the functions in ParticleSystem.cpp
  • Create your own particle class to store the
    property of the particle (partical.h/cpp)
  • e.g. position, veolocity, force, mass, etc.
  • Create a data structure to store the baked
    particles

16
Hints Particle System(2)
  • Important functions
  • startSimulation() is called when you press the
    simulate button and start to play the animation
  • computeForcesAndUpdateParticles() is called
    every time when the scene is drawn (in
    ModelerViewdraw()). You need to check if the
    variable simulate is true
  • stopSimulation() is called when you press the
    simulate button again or the pause button
  • bakeParticles() is called inside the function
    computeForcesAndUpdateParticles(). It is used to
    store the current configuration of the particles

17
Hints Particle System(3)
  • Baking data structure your own design, but
    generally you need to take care of
  • particle positions for every time step when you
    replay it, you can avoid the re-simulation
  • Time information When you change the number of
    frame per second (FPS), the particles should not
    run faster or slower

18
Hints Particle System(3)
  • How to integrate your own particle system?
  • In main function, you can see
  • Just follow the instruction, for example

ParticleSystem ps new ParticleSystem() //...do
some setup ModelerApplicationInstance()-SetPar
ticleSystem(ps)
19
this ppt is at http//www.cse.ust.hk/weiwei/com
p341/lab_1.ppt
Grading sheet is at http//www.cse.ust.hk/weiwe
i/comp341/gradesheet.doc
Write a Comment
User Comments (0)
About PowerShow.com