Last change
on this file since 3390 was
3390,
checked in by bensch, 19 years ago
|
orxonox/branches/nico: heightmap now compiles on all platforms
|
File size:
1.1 KB
|
Rev | Line | |
---|
[3381] | 1 | /* |
---|
| 2 | * ldrawparser.h |
---|
| 3 | * legotown3d |
---|
| 4 | * |
---|
| 5 | * Created by Nico Bernold on 08.01.05. |
---|
| 6 | * Copyright 2005 __MyCompanyName__. All rights reserved. |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include <iostream> |
---|
| 11 | using namespace std; |
---|
| 12 | |
---|
[3390] | 13 | #include "vector.h" |
---|
[3384] | 14 | #include "../stdincl.h" |
---|
[3381] | 15 | |
---|
| 16 | class HeightMapTerrain |
---|
| 17 | { |
---|
| 18 | public: |
---|
| 19 | HeightMapTerrain(); |
---|
| 20 | ~HeightMapTerrain(); |
---|
| 21 | |
---|
| 22 | bool loadBitmap(char* fileName); |
---|
| 23 | |
---|
| 24 | bool createDisplayLists(int width, int height, int levelOfDetail); |
---|
| 25 | |
---|
| 26 | bool readIntoList(int left, int top, int width, int height, int levelOfDetail, GLuint displayListNr); |
---|
| 27 | |
---|
| 28 | // how many display lists are there |
---|
| 29 | int displayListCount; |
---|
| 30 | |
---|
| 31 | // tells from which integer our display lists start |
---|
| 32 | GLuint displayListStart; |
---|
| 33 | |
---|
| 34 | // array of display lists |
---|
[3390] | 35 | //GLuint* displayLists; |
---|
[3381] | 36 | |
---|
| 37 | private: |
---|
| 38 | // returns the height value between 0 and 256 for a point (x,z) in the picture |
---|
[3390] | 39 | GLint getHeightValue(int x, int z); |
---|
| 40 | |
---|
| 41 | // makes a call to glNormal and glVertex for supplied x and z |
---|
| 42 | void call_glNormal_and_glVertex(int x,int z,int top,int left,int height); |
---|
| 43 | |
---|
[3381] | 44 | // holds the loaded pixels |
---|
| 45 | SDL_Surface* bitmap; |
---|
| 46 | |
---|
[3390] | 47 | // holds normal vector for every vertex |
---|
| 48 | Vector* normals; |
---|
| 49 | }; |
---|
[3381] | 50 | |
---|
[3390] | 51 | |
---|
Note: See
TracBrowser
for help on using the repository browser.