Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3014 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Nov 27, 2004, 4:12:26 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/bezierTrack: Track visible. It worked :)

Location:
orxonox/branches/bezierTrack/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/bezierTrack/src/track.cc

    r3013 r3014  
    6363
    6464
     65Vector Track::getPos (float t)
     66{
     67  return curve.calcPos (t);
     68}
     69
    6570/**
    6671   \brief calculate a camera Placement from a "look at"-Location
     
    8186  //  float r = (lookat->dist)*PI / l;
    8287  // camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0);
    83   camplc->pos = curve.calcPos(t) + (curve.calcDir(t)* ((lookat->dist-10.0)/t)) + Vector(-10,0,0);
     88  camplc->pos = curve.calcPos(t) + (curve.calcDir(t)* ((lookat->dist-10.0)/t)) + Vector(-5,0,5);
    8489                                 
    8590  Vector w(0.0,0.0,0.0);
  • orxonox/branches/bezierTrack/src/track.h

    r3013 r3014  
    3838  void addHotPoint (Vector hotPoint);
    3939 
     40  Vector getPos(float t);
     41 
    4042  virtual void post_enter (WorldEntity* entity);        // handle coordinate transition in here !!! (when dist < 0 or dist > lasttracklenght)
    4143  virtual void post_leave (WorldEntity* entity);
  • orxonox/branches/bezierTrack/src/world.cc

    r3013 r3014  
    9999          {
    100100            // create some path nodes
    101             this->pathnodes = new Vector[6];
    102101           
    103102            this->tracklen = 6;
     
    264263  */ 
    265264  //draw track
    266   glBegin(GL_LINES);
     265  glBegin(GL_LINE_STRIP);
    267266  glColor3f(0,1,1);
    268   for( int i = 0; i < tracklen; i++)
    269     {
    270       glVertex3f(pathnodes[i].x,pathnodes[i].y,pathnodes[i].z);
    271       glVertex3f(pathnodes[(i+1)%tracklen].x,pathnodes[(i+1)%tracklen].y,pathnodes[(i+1)%tracklen].z);
     267  for( float i = 0; i <= 1; i+=.01)
     268    {
     269      glVertex3f(track->getPos(i).x, track->getPos(i).y, track->getPos(i).z);
    272270    }
    273271  glEnd();
Note: See TracChangeset for help on using the changeset viewer.