Last change
on this file since 3781 was
3392,
checked in by bensch, 20 years ago
|
orxonox/branches/nico: heightmap now able to readin with SDL-image (if found)
|
File size:
1.1 KB
|
Line | |
---|
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 | |
---|
13 | #include "../stdincl.h" |
---|
14 | |
---|
15 | class HeightMapTerrain |
---|
16 | { |
---|
17 | public: |
---|
18 | HeightMapTerrain(); |
---|
19 | ~HeightMapTerrain(); |
---|
20 | |
---|
21 | bool loadBitmap(char* fileName); |
---|
22 | |
---|
23 | bool createDisplayLists(int width, int height, int levelOfDetail); |
---|
24 | |
---|
25 | bool readIntoList(int left, int top, int width, int height, int levelOfDetail, GLuint displayListNr); |
---|
26 | |
---|
27 | // how many display lists are there |
---|
28 | int displayListCount; |
---|
29 | |
---|
30 | // tells from which integer our display lists start |
---|
31 | GLuint displayListStart; |
---|
32 | |
---|
33 | // array of display lists |
---|
34 | //GLuint* displayLists; |
---|
35 | |
---|
36 | private: |
---|
37 | // returns the height value between 0 and 256 for a point (x,z) in the picture |
---|
38 | GLint getHeightValue(int x, int z); |
---|
39 | |
---|
40 | // makes a call to glNormal and glVertex for supplied x and z |
---|
41 | void call_glNormal_and_glVertex(int x,int z,int top,int left,int height); |
---|
42 | |
---|
43 | // holds the loaded pixels |
---|
44 | SDL_Surface* bitmap; |
---|
45 | |
---|
46 | // holds normal vector for every vertex |
---|
47 | Vector* normals; |
---|
48 | }; |
---|
49 | |
---|
50 | |
---|
Note: See
TracBrowser
for help on using the repository browser.