]> git.mxchange.org Git - flightgear.git/commitdiff
Fiddling with ssg.
authorcurt <curt>
Fri, 18 Jun 1999 16:12:17 +0000 (16:12 +0000)
committercurt <curt>
Fri, 18 Jun 1999 16:12:17 +0000 (16:12 +0000)
README.plib
src/Main/main.cxx
src/Main/views.cxx

index 0bbf51cb954a9960eeb08bb19388ee61f7f090fd..d2a8aaecb0ea97c9eedf156b5a949a02ac3f25bd 100644 (file)
@@ -1,21 +1,13 @@
 You *must* have the plib library installed on your system to build
 the FGFS simulator!"
 
-You can get the original library from:
+You can get the library from:
 
     http://www.woodsoup.org/projs/plib/
 
 Build notes:
 
-When you run "./configure" to configure the package, plib's defaults
-to installing the headers in /usr/local/plib/include and the libraries
-in /usr/local/plib/lib.
-
-If you would prefer to install these in /usr/local/include/plib/ and
-/usr/local/lib, then run configure with the following options:
-
-    ./configure --prefix=/usr/local --includedir=/usr/local/include/plib
-
-Installing into /usr/local/include/plib/ and /usr/local/lib makes it 
-possible for the fgfs configure script to automatically locate the plib 
-includes and libs.
+You should be able to just run "./configure" to configure the package
+and use all of plib's defaults.  Then run "make" followed by "make
+install".  By default, plib installs itself into /usr/local/plib/
+which is where flightgear now expects to find it.
index 265f341185873ed6e59494b82843c2236494a542..75acc429ae4e4ad114b7cfffe9572719102b9646 100644 (file)
@@ -1058,8 +1058,8 @@ int main( int argc, char **argv ) {
     // distribution) specifically from the ssg tux example
     //
 
-    ssgModelPath( "/h/curt/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
-    ssgTexturePath( "/h/curt/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
+    ssgModelPath( "/stage/pinky01/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
+    ssgTexturePath( "/stage/pinky01/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
 
     scene = new ssgRoot;
     penguin = new ssgTransform;
@@ -1071,8 +1071,6 @@ int main( int argc, char **argv ) {
 
     scene->addKid( penguin );
 
-    cout << "loaded ssg scene so it should be ready to go" << endl;
-
     // pass control off to the master GLUT event handler
     glutMainLoop();
 
index 418b6dcf4e4d8af6d9d1568d2330cd044bfc6aec..d7f692add7700ccd791a16bdfedc475226063b8d 100644 (file)
@@ -508,6 +508,8 @@ void FGView::UpdateViewMath( FGInterface *f ) {
     MAT3mat R, TMP, UP, LOCAL, VIEW;
     double ntmp;
 
+    sgMat4 sgLOCAL, sgUP, sgVIEW;
+
     if ( update_fov ) {
        // printf("Updating fov\n");
        UpdateFOV( current_options );
@@ -624,9 +626,34 @@ void FGView::UpdateViewMath( FGInterface *f ) {
        /* printf("Yaw matrix\n");
           MAT3print(TMP, stdout); */
        MAT3mult(LOCAL, R, TMP);
-       // printf("FG derived LOCAL matrix\n");
+       // cout << "FG derived LOCAL matrix using MAT3 routines" << endl;
        // MAT3print(LOCAL, stdout);
 
+       sgMakeRotMat4( sgLOCAL, 
+                      f->get_Psi() * RAD_TO_DEG,
+                      f->get_Phi() * RAD_TO_DEG,
+                      f->get_Theta() * RAD_TO_DEG );
+       /*
+       cout << "FG derived LOCAL matrix using sg routines" << endl;
+       MAT3mat print;
+       int i;
+       int j;
+       for ( i = 0; i < 4; i++ ) {
+           for ( j = 0; j < 4; j++ ) {
+               print[i][j] = sgLOCAL[i][j];
+           }
+       }
+       MAT3print( print, stdout);
+
+       sgMat4 sgIDENT;
+       sgMakeIdentMat4( sgIDENT );
+       for ( i = 0; i < 4; i++ ) {
+           for ( j = 0; j < 4; j++ ) {
+               print[i][j] = sgIDENT[i][j];
+           }
+       }
+       MAT3print( print, stdout);
+       */
     } // if ( use_larcsim_local_to_body ) 
 
 #if !defined(FG_VIEW_INLINE_OPTIMIZATIONS)
@@ -645,9 +672,26 @@ void FGView::UpdateViewMath( FGInterface *f ) {
     // MAT3print(TMP, stdout);
 
     MAT3mult(UP, R, TMP);
-    // printf("Local up matrix\n");
+    // cout << "Local up matrix" << endl;;
     // MAT3print(UP, stdout);
 
+    sgMakeRotMat4( sgUP, 
+                  f->get_Longitude() * RAD_TO_DEG,
+                  0.0,
+                  -f->get_Latitude() * RAD_TO_DEG );
+    /*
+    cout << "FG derived UP matrix using sg routines" << endl;
+    MAT3mat print;
+    int i;
+    int j;
+    for ( i = 0; i < 4; i++ ) {
+       for ( j = 0; j < 4; j++ ) {
+           print[i][j] = sgUP[i][j];
+       }
+    }
+    MAT3print( print, stdout);
+    */
+
     MAT3_SET_VEC(local_up, 1.0, 0.0, 0.0);
     MAT3mult_vec(local_up, local_up, UP);
 
@@ -662,8 +706,20 @@ void FGView::UpdateViewMath( FGInterface *f ) {
 
     // Calculate the VIEW matrix
     MAT3mult(VIEW, LOCAL, UP);
-    // printf("VIEW matrix\n");
-    // MAT3print(VIEW, stdout);
+    cout << "VIEW matrix" << endl;;
+    MAT3print(VIEW, stdout);
+
+    sgMultMat4( sgVIEW, sgLOCAL, sgUP );
+    cout << "FG derived VIEW matrix using sg routines" << endl;
+    MAT3mat print;
+    int i;
+    int j;
+    for ( i = 0; i < 4; i++ ) {
+       for ( j = 0; j < 4; j++ ) {
+           print[i][j] = sgVIEW[i][j];
+       }
+    }
+    MAT3print( print, stdout);
 
     // generate the current up, forward, and fwrd-view vectors
     MAT3_SET_VEC(vec, 1.0, 0.0, 0.0);