Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9974 in orxonox.OLD


Ignore:
Timestamp:
Nov 29, 2006, 5:02:13 PM (17 years ago)
Author:
patrick
Message:

test entit2 working

Location:
branches/playability/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/test_entity2.cc

    r9969 r9974  
    2929#include "player.h"
    3030#include "playable.h"
     31#include "material.h"
    3132
    3233
     
    7677  this->registerObject(this, TestEntity2::_objectList);
    7778  this->toList(OM_GROUP_00);
     79
     80  this->material = new Material();
     81  this->material->setIllum(3);
     82  this->material->setDiffuse(0.0,0.0,0.0);
     83  this->material->setSpecular(0.0,0.0,0.0);
     84  this->material->setAmbient(1.0, 0.0, 1.0);
     85
     86//   this->material->setDiffuseMap("maps/");
    7887}
    7988
     
    9099void TestEntity2::draw() const
    91100{
    92 //   if(!mediaLoaded)
    93 //     false;
    94101
    95 //   glPushAttrib(GL_ENABLE_BIT);
    96 //   glDisable(GL_LIGHTING);
    97 //   glDisable(GL_BLEND);
    98 //
    99 //   glEnable(GL_TEXTURE_2D);
    100 //   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
    101102
     103    glPushMatrix();
    102104    glMatrixMode(GL_MODELVIEW);
    103     glPushMatrix();
     105
    104106
    105107    /* translate */
     
    112114//PRINTF(0)("axis: %f\n", axis);
    113115
    114   glColor3f(1.0, 0, 0);
     116    this->material->select();
     117
     118  glColor3f(0.0, 1.0, 0.0);
    115119
    116120  glBegin(GL_QUADS);
    117121    glVertex3f( 0.0f, -10.0f, 0.0f);
    118     glNormal3f(0.0, 1.0, 0.0);
     122    glNormal3f(1.0, 0.0, 0.0);
    119123//     glTexCoord2f(1.0f, 1.0f);
    120124    glVertex3f( 0.0f,  -10.0f , 20.0f);
    121     glNormal3f(0.0, 1.0, 0.0);
     125    glNormal3f(1.0, 0.0, 0.0);
    122126
    123127//     glTexCoord2f(0.0f, 1.0f);
    124     glVertex3f( 0,  10.0f , 20.0f );
    125     glNormal3f(0.0, 1.0, 0.0);
     128    glVertex3f( 0.0,  10.0f , 20.0f );
     129    glNormal3f(1.0, 0.0, 0.0);
    126130
    127131//     glTexCoord2f(0.0f, 0.0f);
    128     glVertex3f( 0, 10.0f, 0.0f );
    129     glNormal3f(0.0, 1.0, 0.0);
     132    glVertex3f( 0.0, 10.0f, 0.0f );
     133    glNormal3f(1.0, 0.0, 0.0);
    130134
    131135//     glTexCoord2f(1.0f, 0.0f);
    132    
     136
    133137  glEnd();
    134138
    135139  glPopMatrix();
    136 //   glPopAttrib();
     140//    glPopAttrib();
    137141}
    138142
  • branches/playability/src/world_entities/test_entity2.h

    r9969 r9974  
    55
    66class TiXmlElement;
    7 
     7class Material;
    88
    99class TestEntity2 : public WorldEntity
     
    2323    virtual void draw() const;
    2424
     25  private:
     26    Material*       material;
    2527};
    2628
Note: See TracChangeset for help on using the changeset viewer.