






disintegration code
CODE EXPLANATION
Greg Basaraba
James Furdell
Jae Park
This document briefly explains the code used in the disintegration sequence of "Dirty Harry Potter."
The code can be downloaded here. dhp.zip
Effect Outline:
input:
a video sequence of a person in front of a blue screen or other similar such material.
output:
the person disintegrating in front of whatever background one chooses. The energy which disintegrates the person may have any arbitrary texture.
pipeline:
1) Film a person standing in front of a blue screen.
2) Perform chroma-keying to subtract out the background using a package similar to Adobe After Effects.
3) Set the entire background equal to any rgb value one chooses (preferably one which does not conflict with the actors outfit)
4) Input into video munger running our code.
5) Perform texture substitution in either the code (slight modification) or in a program similar to After Effects.
6) done.
Code Outline:
To create the illusion of disintegration, spheres are created using video munger. The inside most area of the
spheres are colored the same as the background, the wavefronts are colored a separate, uniform color, and the points outside of the sphere are left as they are. The center of each sphere changes to follow the center of the person. This is done using a simple tracking algorithm. Furthermore, as time progresses (frames increase) so does the radius of the circles.
The code added is in one of two places. main.cpp or circles.h. Main.cpp contains the callback in which all the real work is done, whereas circles.h defines the circles used to create the illusion of disintegration as well as other helper functions (such as determining if a point lies within a circle).
To run the code one hopefully need only modify a few things to fit the situation:
- define NUMBER_OF_CIRCLES 3
these are the R,G,B values given in an unsigned char which is equal to the uniform background color described above.
- define BG_R
- define BG_G
- define BG_B
this is the frame where you wish the effect to begin
and the frame where you wish it to end (or the end of the file)
- define FRAME_START
- define FRAME_END
this is used primarily to assure the tracking function works correctly. The heuristic is the guess
as to what the center of the person is one probably does not need to use this
- define HUERESTIC_START
- define HUERESTIC_END
this is the point where you wish the effect to begin. It's units are an integer as used by video munger
- define CENTER_OF_CIRCLE
- define END_CENTER_OF_CIRCLE
Circles are simply defined as structures. Some of their values include
speed, radius, center, ending position (if you wish it to stop early), etc.. By tweaking these values one may get the appropriate look.
The circles were created as a hack. Since we only needed a few for our effect, I did not create them dynamically.
Rather they are simply a declaration of three circles with their values hard coded. If one wished to change the code to perhaps use many more circles, it would not be difficult to change.
Link to this Page