Changeset 2780 in orxonox.OLD for orxonox/branches
- Timestamp:
- Nov 10, 2004, 4:34:21 AM (20 years ago)
- Location:
- orxonox/branches/importer/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/importer/importer/framework.cc
r2773 r2780 6 6 Object* obj; 7 7 float rotator = 0.0; 8 GLfloat whiteLight[] = {1.0, 1.0, 0.0,1.0}; 8 9 9 10 void DrawGLScene() … … 18 19 gluPerspective(45.0f,500/375,0.1f,100.0f); 19 20 gluLookAt (5*sin(rotator),7.5,5*cos(rotator), 0,0,0, 0,1,0); 20 21 whiteLight[1] = .5+.5*sin(rotator*10); 22 whiteLight[2] = .5+.5*sin(rotator*10); 23 glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight); 21 24 obj->draw(); 22 25 … … 42 45 43 46 obj = new Object (argv[1]); 47 48 GLfloat lightPosition[] = {10.0, 5.0, 19.0, 0.0}; 49 GLfloat lmodelAmbient[] = {.1, .1, .1, 1.0}; 50 glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); 51 glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight); 52 glLightfv(GL_LIGHT0, GL_SPECULAR, whiteLight); 53 glEnable(GL_LIGHTING); 54 glEnable(GL_LIGHT0); 55 glEnable(GL_DEPTH_TEST); 44 56 45 57 // Build the font from a TGA image font.tga in the data directory -
orxonox/branches/importer/importer/material.cc
r2778 r2780 66 66 diffuse[0] = r; 67 67 diffuse[1] = g; 68 diffuse[2] = b; 68 diffuse[2] = b; 69 diffuse[3] = 1.0; 70 69 71 // printf ("setting Diffuse Color to r=%f g=%f b=%f\n", r, g, b); 70 72 } … … 81 83 ambient[1] = g; 82 84 ambient[2] = b; 85 ambient[3] = 1.0; 83 86 // printf ("setting Ambient Color to r=%f g=%f b=%f\n", r, g, b); 84 87 } … … 95 98 specular[1] = g; 96 99 specular[2] = b; 100 specular[3] = 1.0; 97 101 //printf ("setting Specular Color to r=%f g=%f b=%f\n", r, g, b); 98 102 } … … 131 135 bool Material::select (void) 132 136 { 133 glColor3f (diffuse[0], diffuse[1], diffuse[2]); 137 // setting diffuse color 138 // glColor3f (diffuse[0], diffuse[1], diffuse[2]); 139 glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse); 140 141 // setting ambient color 142 glMaterialfv(GL_FRONT, GL_AMBIENT, ambient); 143 144 // setting up Sprecular 145 glMaterialfv(GL_FRONT, GL_SPECULAR, specular); 146 147 // setting illumination Model 148 if (illumModel == 1) 149 glShadeModel(GL_FLAT); 150 else if (illumModel >= 2) 151 glShadeModel(GL_SMOOTH); 134 152 } -
orxonox/branches/importer/importer/material.h
r2778 r2780 39 39 char name [50]; 40 40 int illumModel; 41 float diffuse [ 3];42 float ambient [ 3];43 float specular [ 3];41 float diffuse [4]; 42 float ambient [4]; 43 float specular [4]; 44 44 float transparency; 45 45
Note: See TracChangeset
for help on using the changeset viewer.