Changeset 5685


Ignore:
Timestamp:
Aug 26, 2008, 11:05:21 AM (14 years ago)
Author:
jack
Message:

Normal calculations for height quantities (fixed).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anugavis/src/height_quantity.cc

    r5684 r5685  
    5757    throw nc_strerror(ncstatus);
    5858}
    59 
     59#include "output.hh"
     60#include <sstream>
     61using std::ostringstream;
    6062void HeightQuantity::compile(int frame){
    6163  size_t start_1[1] = {0};
     
    7880  glNewList(this->display_list, GL_COMPILE);
    7981  glBegin(GL_TRIANGLES);{
    80     for(int volume = 0 ; volume = this->sww_file->number_of_volumes ; ++volume){
     82    for(int volume = 0 ; volume < this->sww_file->number_of_volumes ; ++volume){
    8183      /* Compute normal. */
    8284      Vector vs[3];
     
    8486        int offset = volume * this->sww_file->number_of_vertices + vertex;
    8587        vertIndex = this->sww_file->volumes[offset];
     88        vertIndex = 0;
    8689        vs[vertex] = Vector(this->sww_file->x[vertIndex],
    87                             this->sww_file->y[vertIndex],
    88                             this->points     [vertIndex]);
     90                            this->sww_file->y[vertIndex],
     91                            this->points     [vertIndex]);
    8992      }
    9093      Vector normal = (vs[1] - vs[0]).cross(vs[2] - vs[0]);
     
    9497      /* Insert vertices. */
    9598      for(int vertex = 0 ; vertex < 3 ; ++vertex){
    96         vertIndex = this->sww_file->volumes[volume *
    97                                             this->sww_file->number_of_vertices +
    98                                             vertex];
     99        int offset = volume * this->sww_file->number_of_vertices + vertex;
     100        vertIndex = this->sww_file->volumes[offset];
    99101        glVertex3f(this->sww_file->x[vertIndex],
    100102                   this->sww_file->y[vertIndex],
    101103                   this->points[vertIndex]);
     104       
    102105      }
    103106    }
Note: See TracChangeset for help on using the changeset viewer.