Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

tex_coord_gen.H

Go to the documentation of this file.
00001 
00002 /**********************************************************************
00003  * tex_coord_gen.H:
00004  **********************************************************************/
00005 #ifndef TEX_COORD_GEN_H_IS_INCLUDED
00006 #define TEX_COORD_GEN_H_IS_INCLUDED
00007 
00008 #include "bface.H"
00009 
00010 class TexCoordGen {
00011  protected:
00012 
00013  public:
00014    virtual ~TexCoordGen() {}
00015 
00016    // can be used to setup automatic
00017    // texture coordinate generation:
00018    virtual void setup() = 0;
00019 
00020    // return texture coordinates for a 
00021    // given vertex of a given face:
00022    virtual UVpt uv_from_vert(CBvert*, CBface*) {
00023 
00024       // SUBCLASSES: YOUR CODE HERE
00025 
00026       return UVpt::Origin();
00027    }
00028 
00029 protected:
00030    //base functionality 
00031 
00032    /*
00033    This function is designed to fix seems created by automatic 
00034    assignment of texture coordinates. 
00035    In order to use this pass the newly assigned texture coordinate as "fix_this_coord"
00036    and pass the two other texture coordinates for this face as "coord2"  and "coord3"
00037    all coordinates must be generated by the same formula without fixing them.
00038 
00039    The function will consitently change only one coordinate per face, so you can call it
00040    with the same coordinates in different order and it will only do the fix once.
00041 
00042    If you're still unsure how to use it see "gl_sphir_tex_coord.C"  for reference
00043    */
00044    UVpt fix_seems(CUVpt& fix_this_coord, CUVpt& coord2, CUVpt& coord3);
00045 
00046 
00047 };
00048 
00049 #endif // TEX_COORD_GEN_H_IS_INCLUDED
00050 
00051 /* end of file tex_coord_gen.H */

Generated on Mon Sep 18 11:39:34 2006 for jot by  doxygen 1.4.4