Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5437 in orxonox.OLD


Ignore:
Timestamp:
Oct 26, 2005, 11:01:43 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Sphers Rendered around the Turret-Power-Up (this looks really bad)

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r5428 r5437  
    3939        $(srcdir)/doc/documentation.am $(top_srcdir)/configure AUTHORS \
    4040        COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \
    41         install-sh missing mkinstalldirs
     41        install-sh ltmain.sh missing mkinstalldirs
    4242subdir = .
    4343ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  • trunk/configure

    r5413 r5437  
    54295429echo "${ECHO_T}$ac_cv_lib_ALut_main" >&6
    54305430if test $ac_cv_lib_ALut_main = yes; then
    5431   FOUND_ALUT=yes; LIBS="$LIBS -lALut"
     5431  FOUND_ALUT=yes; LIBS="-lALut $LIBS"
    54325432fi
    54335433
  • trunk/src/lib/graphics/importer/material.cc

    r5374 r5437  
    9191    {
    9292      glEnable(GL_BLEND);
     93      glBlendFunc(GL_SRC_ALPHA, GL_ONE);
    9394      glColor4f(*(this->diffuse), *(this->diffuse+1), *(this->diffuse+2), this->transparency);
    94       glBlendFunc(GL_SRC_ALPHA, GL_ONE);
    9595    }
    9696  else
  • trunk/src/lib/graphics/importer/primitive_model.cc

    r4836 r5437  
    8484        {
    8585          float vj = j/df *PI;
     86          this->addVertexNormal(cos(vi) * cos(vj),
     87                                sin(vj),
     88                                sin(vi) * cos(vj));
     89
    8690          this->addVertex(size * cos(vi) * cos(vj),
    8791                          size * sin(vj),
    8892                          size * sin(vi) * cos(vj));
     93
    8994          this->addVertexTexture(i / (df *2.0), (j-1.0)/(df)+.5);
    9095        }
    9196    }
    9297  this->addVertex(0, -size, 0);
     98  this->addVertexNormal(0, -1, 0);
    9399  this->addVertexTexture(0,0);
    94100  this->addVertex(0, size, 0);
     101  this->addVertexNormal(0, 1, 0);
    95102  this->addVertexTexture(0 ,1);
    96103
     
    119126            {
    120127              v1 = this->getVertexCount() - 2;
    121               this->addFace(3, VERTEX_TEXCOORD, v1, v1, v3, v3, v4, v4);
     128              this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v3, v3, v3, v4, v4, v4);
    122129            }
    123130          else if (j == detail)
    124131            {
    125132              v3 = this->getVertexCount()-1;
    126               this->addFace(3, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3);
     133              this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3);
    127134            }
    128135          else
    129             this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);
     136            this->addFace(4, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3, v4, v4, v4);
    130137        }
    131138    }
  • trunk/src/world_entities/power_ups/turret_power_up.cc

    r5435 r5437  
    2020#include "list.h"
    2121
     22#include "primitive_model.h"
     23
    2224using namespace std;
    2325
    2426CREATE_FACTORY(TurretPowerUp);
    25 
    26 GLUquadricObj* TurretPowerUp_sphereObj = NULL;
    27 Material*      TurretPowerUp_sphereMat = NULL;
    28 
    2927
    3028TurretPowerUp::TurretPowerUp ()
     
    4139
    4240
    43 TurretPowerUp::~TurretPowerUp () {
    44 
     41TurretPowerUp::~TurretPowerUp ()
     42{
     43  delete this->sphereModel;
     44  delete this->sphereMaterial;
    4545}
    4646
     
    5151  this->loadModelWithScale("models/guns/turret1.obj", 2.0);
    5252
    53   if (TurretPowerUp_sphereObj == NULL)
    54     TurretPowerUp_sphereObj = gluNewQuadric();
    55   if(TurretPowerUp_sphereMat == NULL)
    56   {
    57     TurretPowerUp_sphereMat = new Material("TurretPowerUp_Sphere");
    58     TurretPowerUp_sphereMat->setTransparency(.1);
    59   }
     53  this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
     54  this->sphereMaterial = new Material;
     55  this->sphereMaterial->setTransparency(.0001);
     56  this->sphereMaterial->setDiffuse(.1, .1, .8);
     57
    6058  this->rotation = Vector(0,1,0);
    61   this->cycle    = 0;
     59  this->cycle    = (float)rand()/RAND_MAX*M_2_PI;
     60  this->shiftDir(Quaternion((float)rand()/RAND_MAX*M_2_PI, this->rotation));
    6261}
    6362
     
    112111  Vector tmpRot = this->getAbsDir().getSpacialAxis();
    113112  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    114   TurretPowerUp_sphereMat->select();
    115 //  gluSphere(TurretPowerUp_sphereObj, 3, 5, 5);
    116113  this->model->draw();
     114
     115  this->sphereMaterial->select();
     116  this->sphereModel->draw();
    117117  glPopMatrix();
    118 
    119118}
    120119
  • trunk/src/world_entities/power_ups/turret_power_up.h

    r5435 r5437  
    2727   Vector              rotation;
    2828   float               cycle;
     29
     30   Model*              sphereModel;
     31   Material*           sphereMaterial;
    2932};
    3033
Note: See TracChangeset for help on using the changeset viewer.