Changeset 9931 in orxonox.OLD for branches/test/src/world_entities/test_entity.cc
- Timestamp:
- Nov 14, 2006, 4:07:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/test/src/world_entities/test_entity.cc
r9928 r9931 72 72 void TestEntity::init() 73 73 { 74 this->rtri = 0; 75 74 76 this->registerObject(this, TestEntity::_objectList); 75 this->toList(OM_GROUP_0 0);77 this->toList(OM_GROUP_01); 76 78 } 77 79 … … 93 95 void TestEntity::tick (float time) 94 96 { 95 97 this->rtri += 2.0f; 96 98 97 99 } … … 103 105 void TestEntity::draw() const 104 106 { 107 glPushMatrix(); 108 glPushAttrib(GL_ENABLE_BIT); 105 109 110 glMatrixMode(GL_MODELVIEW); 111 glDisable(GL_LIGHTING); 112 //glDisable(GL_BLEND); 113 /* Move the object */ 114 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 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 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 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 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 149 glPopAttrib(); 150 glPopMatrix(); 106 151 } 107 152
Note: See TracChangeset
for help on using the changeset viewer.