Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 21, 2005, 2:22:59 PM (20 years ago)
Author:
bottac
Message:

getHeight implemented
support for 'colour maps'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/height_map/src/lib/graphics/importer/height_map.h

    r6100 r6227  
    1414
    1515
    16 #include "static_model.h"
     16#include "model.h"
     17
     18#define sampleRate 2
    1719
    1820class SDL_Surface;
    1921class Vector;
     22class Material;
     23class PNode;
     24class Texture;
    2025
    21 class HeightMap : public StaticModel
     26class HeightMap : public Model
    2227{
    2328public:
     29void draw();
    2430void load();
    25 void load(const char*, int);
     31void load(int Mode);
     32void load(const char*, int Mode);
     33void scale( Vector V);
     34float getHeight(float x, float y); // x,y relative to HeightMap
    2635HeightMap();
    2736HeightMap(const char*);
     37HeightMap(const char*, const char*);
    2838~HeightMap();
     39
    2940
    3041private:
    3142SDL_Surface* heightMap;
     43SDL_Surface* colourMap;
     44unsigned char* heights;
     45unsigned char* colours;
     46void generateNormalVectorField();
     47void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight );
     48void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight);
     49Vector  **  normalVectorField ;
     50Vector     camCoords;
     51Material * tmp_mat;
     52Material* red_mat;
     53Texture* texture;
     54const PNode* camera;
     55float scaleX ;
     56float scaleY ;
     57float scaleZ ;
     58int   cmScaleX;
     59int   cmScaleY;
     60bool  hasColourMap;
     61inline int abs(int val)
     62{
     63 if(val < 0) val = -val;
     64 return val;
     65}
    3266
    3367};
Note: See TracChangeset for help on using the changeset viewer.