Notes on programming Façade                                             Steve DiPaola

 

 

Façade is a parameterized 3d facial animation program. It can create and display 3d faces and 3d face animations using high level parameters and library features. It is C/C++ program which works on a Windows PC system. It uses standard 3d libraries and is in that respect a very regular 3d graphics program. It does use a more unconventional approach in how it creates and manipulates faces. It uses a parameterized approach which means it cuts the problem space (how a face works) into intelligent parameters that make sense to faces – as opposed to a generalized 3d program that would treat a face like a 3d logo or a 3d chair – just some kind of 3d model made up of polygons.

 

The 3D process in Facade

            3D points (x,y,z) specify a point in space. Models are made up of many connected 3d points. Points are connected into polygons, then color info (rgb), shading info (normals) and texture info (texture coordinates) are specified. This makes a 3d model which can be animated with move, rotation and scale transformations. This model can also be lit and have a camera applied to it -- therefore rendered out to the screen.

In the face program - this points/polygons process makes one base head, and then parameter routines change the points of this model in any one of many eye, mouth and general face areas (there are ~ 80 face parameters). Once all the parameters change the points, the new face is re-rendered to the screen. These parameters can be saved as a key or a library. Calling a key or a Library file applies the parameters that change the points and therefore create a specific face, then it is rendered to the screen. A list of every parameter is the main object of this program, it effectively represents a face. We can save these as libraries of character, emotion or lipsync entries and we can also save them as keys. A key frame system takes certain main positions (for a specific face) over time (say frame 0, 15, and 30) and can interpolated them together to make all the in-between frames (from 0 to 30). Animation is created by interpolating keys to make the current frame ( a list of parameters) applying those parameters at a given frame creating a face and displaying the on the screen. It is important to note that in Facade, point or transformations are not interpolated directly, the only thing that is interpolated are parameters, which then might individually effect points or transformations of the face. This makes Facade more flexible that other general 3d or 3d face programs.

 

 

3D programming

            3D graphics on Macs and PC is a standard process now, so standard routines and hardware is available to an application programmer. There are two main 3D low level programming libraries ( or APIs): Direct3D by Microsoft which is only available on Windows and the other is the open standard OpenGL which is available on every platform. Façade uses OpenGL. OpenGL gives you standard routines to call. Since it is still pretty low level, another library that sits on top of it is available to make calls easier and more high level – this is called GLUT ( GL UTilties). Another issue for programming is what GUI package will be used. All are typically specific to a platform and therefore make it hard to write clean and multi-platform programs. GLUT has some multiplatform features, but to extend its simple GUI features, a newer library is available that sits on top of GLUT ( which sits on top of OpenGL) called GLUI which give you additional and more high level GUI commands. With these libraries is possible to write a 3D package that is simple and can be used on different platforms. Façade then uses a standard programming language “C” ( and C++) to do the basic logic and used the OpenGl/GLUT/GLUI commands to handle the 3d and GUI. These packages are also written in C.

            C programs exist as regular text files with special commands and sytax. These files are “compiled” with a C/C++ compiler ( in our case MS Visual Studio) into an executable – the executable ( façade.exe) is the working program. It is a binary file. So you make updates and changes to the ascii *.c ( and there corresponding *.h) files, debug for errors and compile all together into a working program. This working program needs data files to run. Façade has many 3d model, parameter library, animation, texture, … data files that it uses.

 

What are all the files for:

 

Directories:

            Anims               - directory of animations

            Library             - folder of library files

           

Data Files

            full1.pts            - head points

            full2.pts            - head points ( interpolated)

            full.top              - head polygons

            full.tex              - head texture cordinates          

            fas.keys            - file holding current key frames

            fas.lips              - file holding current lipsync frames

            treeman.bmp    - texture map image

           

C code

            main.c              - the main file - where you start with main subroutine

            display.c           - output routine - send rendering to screen

            keyboard.c       - main keyboard inut loop

            camera.c

           

            fileio.c              - routines to reading and out the data files

 

            params.c          - files containing the face parameters

            mouth.c                        " for the mouth params

            eyes.c               " for the eye params

            muscle.c           " for the muscle params

           

            newkey.c          - routines for making/playing key frames           

            Timer.c             - animation timing routines

           

            p3.c                 - low level graphics routines

            perlin.c - perlin noise routine (not used)

            vect.c               - low level math routines

            header files

           

c++ code

            geo_glui.cpp     - main gui (glui user interface routines)

            undo.cpp         

 

Microsoft compilation file

            geoface.dsp

            geoface.dsw     - for compiling code in MS Visual Studio

           

Executable program

            facade.exe        - main program ( made by code)

           

dlls and libraries ( binary code) - other programs used by code

            glut32.dll

            glut32.lib

            glui32.lib