Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/height_map/src/lib/graphics/importer/height_map.cc @ 5942

Last change on this file since 5942 was 5942, checked in by bottac, 18 years ago
  • Property svn:executable set to *
File size: 2.7 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer:
13*/
14
15#include "height_map.h"
16#include "model.h"
17
18HeightMap::HeightMap() : Model()
19{
20}
21
22void HeightMap::load()
23{
24   
25         this->setName("HardCore");
26  this->addVertex (-0.5, -0.5, 0.5);
27  this->addVertex (0.5, -0.5, 0.5);
28  this->addVertex (-0.5, 0.5, 0.5);
29  this->addVertex (0.5, 0.5, 0.5);
30  this->addVertex (-0.5, 0.5, -0.5);
31  this->addVertex (0.5, 0.5, -0.5);
32  this->addVertex (-0.5, -0.5, -0.5);
33  this->addVertex (0.5, -0.5, -0.5);
34
35  this->addVertexTexture (0.0, 0.0);
36  this->addVertexTexture (1.0, 0.0);
37  this->addVertexTexture (0.0, 1.0);
38  this->addVertexTexture (1.0, 1.0);
39  this->addVertexTexture (0.0, 2.0);
40  this->addVertexTexture (1.0, 2.0);
41  this->addVertexTexture (0.0, 3.0);
42  this->addVertexTexture (1.0, 3.0);
43  this->addVertexTexture (0.0, 4.0);
44  this->addVertexTexture (1.0, 4.0);
45  this->addVertexTexture (2.0, 0.0);
46  this->addVertexTexture (2.0, 1.0);
47  this->addVertexTexture (-1.0, 0.0);
48  this->addVertexTexture (-1.0, 1.0);
49
50  this->addVertexNormal (0.0, 0.0, 1.0);
51  this->addVertexNormal (0.0, 0.0, 1.0);
52  this->addVertexNormal (0.0, 0.0, 1.0);
53  this->addVertexNormal (0.0, 0.0, 1.0);
54  this->addVertexNormal (0.0, 1.0, 0.0);
55  this->addVertexNormal (0.0, 1.0, 0.0);
56  this->addVertexNormal (0.0, 1.0, 0.0);
57  this->addVertexNormal (0.0, 1.0, 0.0);
58  this->addVertexNormal (0.0, 0.0, -1.0);
59  this->addVertexNormal (0.0, 0.0, -1.0);
60  this->addVertexNormal (0.0, 0.0, -1.0);
61  this->addVertexNormal (0.0, 0.0, -1.0);
62  this->addVertexNormal (0.0, -1.0, 0.0);
63  this->addVertexNormal (0.0, -1.0, 0.0);
64  this->addVertexNormal (0.0, -1.0, 0.0);
65  this->addVertexNormal (0.0, -1.0, 0.0);
66  this->addVertexNormal (1.0, 0.0, 0.0);
67  this->addVertexNormal (1.0, 0.0, 0.0);
68  this->addVertexNormal (1.0, 0.0, 0.0);
69  this->addVertexNormal (1.0, 0.0, 0.0);
70  this->addVertexNormal (-1.0, 0.0, 0.0);
71  this->addVertexNormal (-1.0, 0.0, 0.0);
72  this->addVertexNormal (-1.0, 0.0, 0.0);
73  this->addVertexNormal (-1.0, 0.0, 0.0);
74
75  this->addFace (3, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,1, 3,3,2);
76  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,4, 3,3,5, 5,5,6, 4,4,7);
77  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,4,8, 5,5,9, 7,7,10, 6,6,11);
78  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,6,12, 7,7,13, 1,9,14, 0,8,15);
79  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,16, 7,10,17, 5,11,18, 3,3,19);
80  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,12,20, 0,0,21, 2,2,22, 4,13,23);
81
82      this->finalize();
83
84
85}
Note: See TracBrowser for help on using the repository browser.