Ignore:
Timestamp:
03/15/06 08:59:33 (18 years ago)
Author:
mattausch
Message:

added means for rotating scene

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp

    r693 r694  
    5454static SAXParser::ValSchemes    valScheme       = SAXParser::Val_Auto; 
    5555 
    56  
     56#define ROTATE_SCENE 1 
    5757 
    5858 
     
    8383  StrX lname(name); 
    8484  string element(lname.LocalForm()); 
     85   
    8586  if (element == "Shape") 
    8687    EndShape(); 
    8788} 
    8889 
    89 // HACK 
    90 void RotateMesh(Mesh *mesh) 
    91 { 
    92         VertexContainer::const_iterator it, it_end = mesh->mVertices.end(); 
     90 
     91static void RotateMesh(Mesh *mesh) 
     92{ 
     93        VertexContainer::iterator it, it_end = mesh->mVertices.end(); 
    9394 
    9495        const float angle = 30.0f * PI / 180.0f; 
    95         const Matrix4x4 rot = RotationYMatrix(30); 
     96        const Matrix4x4 rot = RotationYMatrix(angle); 
    9697 
    9798        for (it = mesh->mVertices.begin(); it != it_end; ++ it) 
    9899        { 
    99                 const Vector3 pt = rot * (*it); 
     100                (*it) = rot * (*it);         
    100101        } 
    101102} 
     
    124125                         
    125126                        mesh->mFaces.push_back(new Face(vc)); 
    126                         if (0) 
     127                        //if (ROTATE_SCENE) 
    127128                                RotateMesh(mesh); 
    128129                        mesh->Preprocess(); 
     
    142143                { 
    143144                        // HACK 
    144                         if (0) 
     145                        //if (ROTATE_SCENE) 
    145146                                RotateMesh(mCurrentMesh); 
    146147                        mCurrentMesh->Preprocess(); 
     
    156157                        delete mCurrentMesh; 
    157158                } 
     159 
    158160                mCurrentMesh = NULL; 
    159161        } 
     
    246248 
    247249 
    248                         while(1)  
     250                        while (1)  
    249251                        { 
    250252                                float x = (float)strtod(ptr, &endptr); 
     
    298300    StartIndexedFaceSet(attributes); 
    299301  } 
    300  
     302  
    301303  if (element == "Shape") { 
    302     cout<<"+"; 
     304    cout << "+"; 
    303305        mCurrentMesh = new Mesh; 
    304306  } 
     
    503505  StrX lname(name); 
    504506  string element(lname.LocalForm()); 
     507  
    505508  if (element == "Shape") 
    506509    EndShape(); 
Note: See TracChangeset for help on using the changeset viewer.