Ignore:
Timestamp:
06/17/08 03:47:02 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/CHC_revisited/Camera.cpp

    r2762 r2764  
    2929        mDirection.Normalize(); 
    3030 
    31         Vector3 side = CrossProd(Vector3(0, 1, 0), mDirection); 
     31        //Vector3 side = CrossProd(Vector3(0, 1, 0), mDirection); 
     32        Vector3 side = CrossProd(Vector3(0, 0, 1), mDirection); 
     33         
    3234        mUp = -Normalize(CrossProd(side, mDirection)); 
    3335        mRight = -Normalize(CrossProd(mDirection, mUp)); 
     36 
    3437 
    3538        float k = tan(mFovy/2); 
     
    5356 
    5457 
     58void Camera::SetNear(float nearDist)  
     59{ 
     60        mNear = nearDist; 
     61} 
     62 
     63 
    5564void Camera::LookInBox(const AxisAlignedBox3 &box) 
    5665{ 
    57         mDirection = Vector3(0, 0, 1); 
     66        //mDirection = Vector3(0, 0, 1); 
     67        mDirection = Vector3(0, 1, 0); 
    5868        mPosition = box.Center(); 
    59         mPosition.y += 50; 
     69        mPosition.z = box.Min(2) + 0.9f * box.Size(2); 
    6070 
    6171        Precompute(); 
     
    6575void Camera::LookAtBox(const AxisAlignedBox3 &box) 
    6676{ 
    67         mDirection = Vector3(0, 0, box.Min().z - box.Max().z); 
     77        mDirection = Vector3(0, box.Min().y - box.Max().y, 0); 
    6878        mPosition = Vector3(0);//box.Max() - mDirection; 
    6979 
Note: See TracChangeset for help on using the changeset viewer.