]> git.mxchange.org Git - flightgear.git/commitdiff
Solved some scenery display/orientation problems. Still have a positioning
authorcurt <curt>
Fri, 11 Jul 1997 03:23:18 +0000 (03:23 +0000)
committercurt <curt>
Fri, 11 Jul 1997 03:23:18 +0000 (03:23 +0000)
(or transformation?) problem.

Main/GLmain.c
Main/mesh2GL.c
Scenery/mesh.c
Scenery/scenery.c

index 652c1d40ece1284ac0cb1b5eb4638bdb22a29672..d299528c7b8a86c55d709028ab0a2b370bc8c709 100644 (file)
@@ -173,7 +173,7 @@ static void fgUpdateViewParams() {
     /* MAT3mult_vec(vec, vec, R); */
     /* MAT3rotate(TMP, vec, M_PI + M_PI_2 + FG_Psi + view_offset); */
     MAT3rotate(TMP, vec, FG_Psi - M_PI_2);
   /* printf("Yaw matrix\n");
+ /* printf("Yaw matrix\n");
     MAT3print(TMP, stdout); */
     MAT3mult(R, R, TMP);
 
@@ -496,10 +496,11 @@ int main( int argc, char *argv[] ) {
     /* Initial Position */
     FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
     FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
-    /* FG_Latitude  = 0.0;
-    FG_Longitude = 0.0; */
     FG_Altitude = FG_Runway_altitude + 3.758099;
-    FG_Altitude = 15000.0;
+
+    /* FG_Latitude  = 0.0; */
+    /* FG_Longitude = 0.0; */
+    /* FG_Altitude = 15000.0; */
 
     printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude, 
           FG_Longitude, FG_Altitude);
@@ -512,7 +513,7 @@ int main( int argc, char *argv[] ) {
     /* Initial Orientation */
     FG_Phi   = -2.658474E-06;
     FG_Theta =  7.401790E-03;
-    FG_Psi   =  282.0 * DEG_TO_RAD;
+    FG_Psi   =  270.0 * DEG_TO_RAD;
 
     /* Initial Angular B rates */
     FG_P_body = 7.206685E-05;
@@ -611,9 +612,13 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.31  1997/07/11 01:29:58  curt
-/* More tweaking of terrian floor.
+/* Revision 1.32  1997/07/11 03:23:18  curt
+/* Solved some scenery display/orientation problems.  Still have a positioning
+/* (or transformation?) problem.
 /*
+ * Revision 1.31  1997/07/11 01:29:58  curt
+ * More tweaking of terrian floor.
+ *
  * Revision 1.30  1997/07/10 04:26:37  curt
  * We now can interpolated ground elevation for any position in the grid.  We
  * can use this to enforce a "hard" ground.  We still need to enforce some
index 8d41c51dc9be7233a26014be98d8ee96ad28934e..2b84ce9fd355600fddc290ec581726f97ad35c77 100644 (file)
@@ -86,10 +86,10 @@ GLint mesh2GL(struct mesh *m) {
            p22 = fgGeodetic2Cartesian(x2*ARCSEC_TO_RAD, y2*ARCSEC_TO_RAD);
            p22 = fgRotateCartesianPoint(p22);
 
-           z11 = 0.001 * m->mesh_data[j         * m->rows + i        ];
-           z12 = 0.001 * m->mesh_data[j         * m->rows + (i+istep)];
-           z21 = 0.001 * m->mesh_data[(j+jstep) * m->rows + i        ];
-           z22 = 0.001 * m->mesh_data[(j+jstep) * m->rows + (i+istep)];
+           z11 = 0.001 * m->mesh_data[i         * m->cols + j        ];
+           z12 = 0.001 * m->mesh_data[(i+istep) * m->cols + j        ];
+           z21 = 0.001 * m->mesh_data[i         * m->cols + (j+jstep)];
+           z22 = 0.001 * m->mesh_data[(i+istep) * m->cols + (j+jstep)];
 
            v1[0] = p22.y - p11.y; v1[1] = p22.z - p11.z; v1[2] = z22 - z11;
            v2[0] = p12.y - p11.y; v2[1] = p12.z - p11.z; v2[2] = z12 - z11;
@@ -101,8 +101,8 @@ GLint mesh2GL(struct mesh *m) {
            
            if ( j == 0 ) {
                /* first time through */
-               glVertex3d(p11.y, p11.z, z11);
                glVertex3d(p12.y, p12.z, z12);
+               glVertex3d(p11.y, p11.z, z11);
            }
            
            glVertex3d(p22.y, p22.z, z22);
@@ -116,13 +116,13 @@ GLint mesh2GL(struct mesh *m) {
 
            glVertex3d(p21.y, p21.z, z21);
 
-           x1 = x2;
-           x2 = x1 + (m->row_step * jstep);
+           x1 += m->row_step * jstep;
+           x2 += m->row_step * jstep;
        }
        glEnd();
 
-       y1 = y2;
-       y2 = y1 + (m->col_step * istep);
+       y1 += m->col_step * istep;
+       y2 += m->col_step * istep;
     }
 
     glEndList();
@@ -133,9 +133,13 @@ GLint mesh2GL(struct mesh *m) {
 
 
 /* $Log$
-/* Revision 1.29  1997/07/11 01:29:58  curt
-/* More tweaking of terrian floor.
+/* Revision 1.30  1997/07/11 03:23:18  curt
+/* Solved some scenery display/orientation problems.  Still have a positioning
+/* (or transformation?) problem.
 /*
+ * Revision 1.29  1997/07/11 01:29:58  curt
+ * More tweaking of terrian floor.
+ *
  * Revision 1.28  1997/07/10 04:26:37  curt
  * We now can interpolated ground elevation for any position in the grid.  We
  * can use this to enforce a "hard" ground.  We still need to enforce some
index de1f149c5467f4de2838461773a5e07ef4c6afd1..ff49208f56bbb58f9120c7ed7fef0c8f29de1c05 100644 (file)
@@ -116,7 +116,7 @@ void mesh_set_option_value(struct mesh *m, char *value) {
        /* mesh data is a pseudo 2d array */
        /* printf("Setting mesh_data[%d][%d] to %s\n", m->cur_row, m->cur_col, 
               value); */
-       m->mesh_data[m->cur_row * m->rows + m->cur_col] = atof(value);
+       m->mesh_data[m->cur_row * m->cols + m->cur_col] = atof(value);
        m->cur_col++;
        if ( m->cur_col >= m->cols ) {
            m->cur_col = 0;
@@ -193,15 +193,15 @@ double mesh_altitude(double lon, double lat) {
 
        x1 = xindex; 
        y1 = yindex; 
-       z1 = eg.mesh_data[x1 * eg.rows + y1];
+       z1 = eg.mesh_data[y1 * eg.cols + x1];
 
        x2 = xindex + skip; 
        y2 = yindex; 
-       z2 = eg.mesh_data[x2 * eg.rows + y2];
+       z2 = eg.mesh_data[y2 * eg.cols + x2];
                                  
        x3 = xindex + skip; 
        y3 = yindex + skip; 
-       z3 = eg.mesh_data[x3 * eg.rows + y3];
+       z3 = eg.mesh_data[y3 * eg.cols + x3];
 
        /* printf("  dx = %.2f  dy = %.2f\n", dx, dy);
        printf("  (x1,y1,z1) = (%d,%d,%d)\n", x1, y1, z1);
@@ -220,15 +220,15 @@ double mesh_altitude(double lon, double lat) {
 
        x1 = xindex; 
        y1 = yindex; 
-       z1 = eg.mesh_data[x1 * eg.rows + y1];
+       z1 = eg.mesh_data[y1 * eg.cols + x1];
 
        x2 = xindex; 
        y2 = yindex + skip; 
-       z2 = eg.mesh_data[x2 * eg.rows + y2];
+       z2 = eg.mesh_data[y2 * eg.cols + x2];
                                  
        x3 = xindex + skip; 
        y3 = yindex + skip; 
-       z3 = eg.mesh_data[x3 * eg.rows + y3];
+       z3 = eg.mesh_data[y3 * eg.cols + x3];
 
        /* printf("  dx = %.2f  dy = %.2f\n", dx, dy);
        printf("  (x1,y1,z1) = (%d,%d,%d)\n", x1, y1, z1);
@@ -249,9 +249,13 @@ double mesh_altitude(double lon, double lat) {
 
 
 /* $Log$
-/* Revision 1.11  1997/07/11 01:30:02  curt
-/* More tweaking of terrian floor.
+/* Revision 1.12  1997/07/11 03:23:19  curt
+/* Solved some scenery display/orientation problems.  Still have a positioning
+/* (or transformation?) problem.
 /*
+ * Revision 1.11  1997/07/11 01:30:02  curt
+ * More tweaking of terrian floor.
+ *
  * Revision 1.10  1997/07/10 04:26:38  curt
  * We now can interpolated ground elevation for any position in the grid.  We
  * can use this to enforce a "hard" ground.  We still need to enforce some
index 00e0327910c9d82428b2a361fc9801121a4bae0e..922dbe429e277dde26b3073a969cfabc2e6c5f46 100644 (file)
@@ -41,7 +41,7 @@ struct scenery_params cur_scenery_params;
 /* Initialize the Scenery Management system */
 void fgSceneryInit() {
     /* set the default terrain detail level */
-    cur_scenery_params.terrain_skip = 10;
+    cur_scenery_params.terrain_skip = 4;
 }
 
 
@@ -65,9 +65,13 @@ void fgSceneryRender() {
 
 
 /* $Log$
-/* Revision 1.4  1997/07/11 01:30:03  curt
-/* More tweaking of terrian floor.
+/* Revision 1.5  1997/07/11 03:23:19  curt
+/* Solved some scenery display/orientation problems.  Still have a positioning
+/* (or transformation?) problem.
 /*
+ * Revision 1.4  1997/07/11 01:30:03  curt
+ * More tweaking of terrian floor.
+ *
  * Revision 1.3  1997/06/29 21:16:50  curt
  * More twiddling with the Scenery Management system.
  *