Changeset 9932 in orxonox.OLD for branches/test
- Timestamp:
- Nov 14, 2006, 4:13:15 PM (18 years ago)
- Location:
- branches/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/test/sdl_opengl_test/sdl_opengl_test.cc
r9930 r9932 160 160 // das ist der code, der in eine WorldEntity::draw() funktion passen wuerde 161 161 162 glLoadIdentity(); 163 /* Move the object */ 164 glTranslatef(0.0f, 0.0f, -6.0f); 165 166 /* Rotate The Triangle On The Y axis */ 167 glRotatef(rtri, 0.0f, 1.0f, 0.0f); 168 169 /* Drawing the Triangles4 */ 170 glBegin(GL_TRIANGLES); /* Drawing Using Triangles */ 171 glColor3f( 2.0f, 0.0f, 0.0f); /* Red */ 172 glVertex3f( 0.0f, 2.0f, 0.0f); /* Top Of Triangle (Front) */ 173 glColor3f( 0.0f, 2.0f, 0.0f); /* Green */ 174 glVertex3f(-2.0f, -2.0f, 2.0f); /* Left Of Triangle (Front) */ 175 glColor3f( 0.0f, 0.0f, 2.0f); /* Blue */ 176 glVertex3f( 2.0f, -2.0f, 2.0f); /* Right Of Triangle (Front) */ 177 178 glColor3f( 2.0f, 0.0f, 0.0f); /* Red */ 179 glVertex3f( 0.0f, 2.0f, 0.0f); /* Top Of Triangle (Right) */ 180 glColor3f( 0.0f, 0.0f, 2.0f); /* Blue */ 181 glVertex3f( 2.0f, -2.0f, 2.0f); /* Left Of Triangle (Right) */ 182 glColor3f( 0.0f, 2.0f, 0.0f); /* Green */ 183 glVertex3f( 2.0f, -2.0f, -2.0f); /* Right Of Triangle (Right) */ 184 185 glColor3f( 2.0f, 0.0f, 0.0f); /* Red */ 186 glVertex3f( 0.0f, 2.0f, 0.0f); /* Top Of Triangle (Back) */ 187 glColor3f( 0.0f, 2.0f, 0.0f); /* Green */ 188 glVertex3f( 2.0f, -2.0f, -2.0f); /* Left Of Triangle (Back) */ 189 glColor3f( 0.0f, 0.0f, 2.0f); /* Blue */ 190 glVertex3f(-2.0f, -2.0f, -2.0f); /* Right Of Triangle (Back) */ 191 192 glColor3f( 2.0f, 0.0f, 0.0f); /* Red */ 193 glVertex3f( 0.0f, 2.0f, 0.0f); /* Top Of Triangle (Left) */ 194 glColor3f( 0.0f, 0.0f, 2.0f); /* Blue */ 195 glVertex3f(-2.0f, -2.0f, -2.0f); /* Left Of Triangle (Left) */ 196 glColor3f( 0.0f, 2.0f, 0.0f); /* Green */ 197 glVertex3f(-2.0f, -2.0f, 2.0f); /* Right Of Triangle (Left) */ 198 glEnd(); /* Finished Drawing The Triangles */ 162 199 163 /* ================================== WorldEntity zeichnen fertig ================================ */ 200 164 -
branches/test/src/world_entities/test_entity.cc
r9931 r9932 72 72 void TestEntity::init() 73 73 { 74 this->rtri = 0;75 76 74 this->registerObject(this, TestEntity::_objectList); 77 75 this->toList(OM_GROUP_01); … … 95 93 void TestEntity::tick (float time) 96 94 { 97 this->rtri += 2.0f;98 95 99 96 } … … 110 107 glMatrixMode(GL_MODELVIEW); 111 108 glDisable(GL_LIGHTING); 112 //glDisable(GL_BLEND); 113 /* Move the object */109 110 /* Move the object near the starting point of our spaceship*/ 114 111 glTranslatef(-1200.0f, 300.0f, 700.0f); 115 glRotatef(rtri, 0.0f, 1.0f, 0.0f);116 /* Rotate The Triangle On The Y axis */117 112 118 /* Drawing the Triangles4 */119 glBegin(GL_TRIANGLES); /* Drawing Using Triangles */120 glColor3f( 20, 0.0f, 0.0f); /* Red */121 glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Front) */122 glColor3f( 0.0f, 20, 0.0f); /* Green */123 glVertex3f(-20, -20, 20); /* Left Of Triangle (Front) */124 glColor3f( 0.0f, 0.0f, 20); /* Blue */125 glVertex3f( 20, -20, 20); /* Right Of Triangle (Front) */126 113 127 glColor3f( 20, 0.0f, 0.0f); /* Red */128 glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Right) */129 glColor3f( 0.0f, 0.0f, 20); /* Blue */130 glVertex3f( 20, -20, 20); /* Left Of Triangle (Right) */131 glColor3f( 0.0f, 20, 0.0f); /* Green */132 glVertex3f( 20, -20, -20); /* Right Of Triangle (Right) */133 114 134 glColor3f( 20, 0.0f, 0.0f); /* Red */135 glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Back) */136 glColor3f( 0.0f, 20, 0.0f); /* Green */137 glVertex3f( 20, -20, -20); /* Left Of Triangle (Back) */138 glColor3f( 0.0f, 0.0f, 20); /* Blue */139 glVertex3f(-20, -20, -20); /* Right Of Triangle (Back) */140 115 141 glColor3f( 20, 0.0f, 0.0f); /* Red */ 142 glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Left) */ 143 glColor3f( 0.0f, 0.0f, 20); /* Blue */ 144 glVertex3f(-20, -20, -20); /* Left Of Triangle (Left) */ 145 glColor3f( 0.0f, 20, 0.0f); /* Green */ 146 glVertex3f(-20, -20, 20); /* Right Of Triangle (Left) */ 147 glEnd(); /* Finished Drawing The Triangles */ 148 116 117 149 118 glPopAttrib(); 150 119 glPopMatrix();
Note: See TracChangeset
for help on using the changeset viewer.