]> git.mxchange.org Git - flightgear.git/commitdiff
Added GNU copyright headers.
authorcurt <curt>
Fri, 23 May 1997 15:40:24 +0000 (15:40 +0000)
committercurt <curt>
Fri, 23 May 1997 15:40:24 +0000 (15:40 +0000)
Fog now works!

Main/GLTKkey.c
Main/GLTKkey.h
Main/GLUTkey.c
Main/GLUTkey.h
Main/GLmain.c
Main/Makefile
Main/mesh2GL.c

index 917756581c4339b0a96825b04cd0843fd93d282a..c34bdc3c755bc4881cda3eec6f6fa0cca958343c 100644 (file)
@@ -3,6 +3,22 @@
  *
  * Written by Curtis Olson, started May 1997.
  *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
@@ -58,9 +74,13 @@ GLenum GLTKkey(int k, GLenum mask) {
 
 
 /* $Log$
-/* Revision 1.1  1997/05/21 15:57:49  curt
-/* Renamed due to added GLUT support.
+/* Revision 1.2  1997/05/23 15:40:24  curt
+/* Added GNU copyright headers.
+/* Fog now works!
 /*
+ * Revision 1.1  1997/05/21 15:57:49  curt
+ * Renamed due to added GLUT support.
+ *
  * Revision 1.2  1997/05/19 18:22:41  curt
  * Parameter tweaking ... starting to stub in fog support.
  *
index 4795385a0a0af18b79bc71336c8115c0ffb866e5..ea43eda2ebc306580c215705c73ede2f35bd8a99 100644 (file)
@@ -3,6 +3,22 @@
  *
  * Written by Curtis Olson, started May 1997.
  *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
@@ -23,9 +39,13 @@ GLenum GLTKkey(int k, GLenum mask);
 
 
 /* $Log$
-/* Revision 1.1  1997/05/21 15:57:49  curt
-/* Renamed due to added GLUT support.
+/* Revision 1.2  1997/05/23 15:40:24  curt
+/* Added GNU copyright headers.
+/* Fog now works!
 /*
+ * Revision 1.1  1997/05/21 15:57:49  curt
+ * Renamed due to added GLUT support.
+ *
  * Revision 1.2  1997/05/17 00:17:34  curt
  * Trying to stub in support for standard OpenGL.
  *
index 1118c9a909f0bc5d442471d7bebd034950bd975c..c3bd9a8cb11d6a15186919185913c73ab3542df4 100644 (file)
@@ -3,6 +3,22 @@
  *
  * Written by Curtis Olson, started May 1997.
  *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
@@ -68,9 +84,13 @@ void GLUTkey(unsigned char k, int x, int y) {
 
 
 /* $Log$
-/* Revision 1.2  1997/05/23 00:35:12  curt
-/* Trying to get fog to work ...
+/* Revision 1.3  1997/05/23 15:40:25  curt
+/* Added GNU copyright headers.
+/* Fog now works!
 /*
+ * Revision 1.2  1997/05/23 00:35:12  curt
+ * Trying to get fog to work ...
+ *
  * Revision 1.1  1997/05/21 15:57:50  curt
  * Renamed due to added GLUT support.
  *
index 66982b9b3514bb4738bca246f1eb934879eefa66..8294048a3f9462229d2fd691af4aab4c8da57c06 100644 (file)
@@ -3,6 +3,22 @@
  *
  * Written by Curtis Olson, started May 1997.
  *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
@@ -27,9 +43,13 @@ void GLUTkey(unsigned char k, int x, int y);
 
 
 /* $Log$
-/* Revision 1.1  1997/05/21 15:57:51  curt
-/* Renamed due to added GLUT support.
+/* Revision 1.2  1997/05/23 15:40:25  curt
+/* Added GNU copyright headers.
+/* Fog now works!
 /*
+ * Revision 1.1  1997/05/21 15:57:51  curt
+ * Renamed due to added GLUT support.
+ *
  * Revision 1.2  1997/05/17 00:17:34  curt
  * Trying to stub in support for standard OpenGL.
  *
index e571100952921d97230d350f874d61994f4fa8d3..39250612ea0d488939ca163507b6d04ad15d99aa 100644 (file)
@@ -3,6 +3,22 @@
  *
  * Written by Curtis Olson for OpenGL, started May 1997.
  *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
@@ -44,7 +60,7 @@ static GLfloat win_ratio = 1.0;
 /* pointer to terrain mesh structure */
 static GLint mesh;
 
-double fogDensity = 0.04;
+double fogDensity = 0.001;
 
 /* init_view() -- Setup view parameters */
 static void init_view() {
@@ -68,11 +84,11 @@ static void init_view() {
     glShadeModel( GL_FLAT ); /* glShadeModel( GL_SMOOTH ); */
 
     glEnable( GL_FOG );
-    glFogi (GL_FOG_MODE, GL_EXP);
+    glFogi (GL_FOG_MODE, GL_LINEAR);
     /* glFogf (GL_FOG_START, 1.0); */
-    /* glFogf (GL_FOG_END, 1000.0); */
+    glFogf (GL_FOG_END, 2000.0);
     glFogfv (GL_FOG_COLOR, fogColor);
-    glFogf (GL_FOG_DENSITY, fogDensity);
+    /* glFogf (GL_FOG_DENSITY, fogDensity); */
     /* glHint (GL_FOG_HINT, GL_FASTEST); */
 
     glClearColor(0.6, 0.6, 0.9, 1.0);
@@ -91,7 +107,7 @@ static void init_scene() {
 GLint make_mesh() {
     GLint mesh;
 
-    mesh = mesh_to_ogl(mesh_ptr);
+    mesh = mesh2GL(mesh_ptr);
 
     return(mesh);
 }
@@ -106,8 +122,10 @@ static void update_view() {
     /* Tell GL we are about to modify the projection parameters */
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
-
     gluPerspective(45.0, 1.0/win_ratio, 1.0, 6000.0);
+
+    glMatrixMode(GL_MODELVIEW);
+    glLoadIdentity();
     gluLookAt(f->pos_x, f->pos_y, f->pos_z,
              f->pos_x + cos(f->Psi), f->pos_y + sin(f->Psi), f->pos_z,
              0.0, 0.0, 1.0);
@@ -123,7 +141,7 @@ static void draw_scene( void ) {
 
     /* Tell GL we are switching to model view parameters */
     glMatrixMode(GL_MODELVIEW);
-    glLoadIdentity();
+    /* glLoadIdentity(); */
 
     /* draw terrain mesh */
     draw_mesh();
@@ -211,8 +229,7 @@ int main( int argc, char *argv[] ) {
 
     /* Set initial position and slew parameters */
     /* slew_init(-398391.3, 120070.4, 244, 3.1415); */ /* GLOBE Airport */
-    /* slew_init(-398673.28,120625.64, 53, 4.38); */
-    slew_init(0.0, 0.0, 53, 0.77); 
+    slew_init(-398673.28,120625.64, 53, 4.38);
 
     #ifdef GLUT
       /* call reshape() on window resizes */
@@ -255,9 +272,13 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.2  1997/05/23 00:35:12  curt
-/* Trying to get fog to work ...
+/* Revision 1.3  1997/05/23 15:40:25  curt
+/* Added GNU copyright headers.
+/* Fog now works!
 /*
+ * Revision 1.2  1997/05/23 00:35:12  curt
+ * Trying to get fog to work ...
+ *
  * Revision 1.1  1997/05/21 15:57:51  curt
  * Renamed due to added GLUT support.
  *
index 1875f429e83cfbf079d167602954ad81381e0f20..7abf6087dc4394d8fb4d5324d40d0adc54b9bb96 100644 (file)
@@ -3,6 +3,22 @@
 #
 # Written by Curtis Olson, started May 1997.
 #
+# Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
 # $Id$
 # (Log is kept at end of this file)
 #---------------------------------------------------------------------------
@@ -86,6 +102,10 @@ mesh2GL.o: mesh2GL.c ../scenery/mesh.h
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.4  1997/05/23 15:40:26  curt
+# Added GNU copyright headers.
+# Fog now works!
+#
 # Revision 1.3  1997/05/23 00:35:13  curt
 # Trying to get fog to work ...
 #
index 8a75cab12239c619e4b9bec6fa4adef7b5765ff5..22646dbce9358441e544909e57c0f8b744fdec41 100644 (file)
@@ -3,6 +3,22 @@
  *
  * Written by Curtis Olson, started May 1997.
  *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
@@ -35,7 +51,7 @@ static void mat3_cross_product(float result_vec[3], register float vec1[3],
 
 
 /* walk through mesh and make ogl calls */
-GLint mesh_to_ogl(struct mesh *m) {
+GLint mesh2GL(struct mesh *m) {
     GLint mesh;
     /* static GLfloat color[4] = { 0.3, 0.7, 0.2, 1.0 }; */
 
@@ -44,7 +60,7 @@ GLint mesh_to_ogl(struct mesh *m) {
     int i, j, istep, jstep, iend, jend;
     float temp;
 
-    istep = jstep = 25;  /* Detail level 1 -- 1200 ... */
+    istep = jstep = 10;  /* Detail level 1 -- 1200 ... */
 
     mesh = glGenLists(1);
     glNewList(mesh, GL_COMPILE);
@@ -53,11 +69,11 @@ GLint mesh_to_ogl(struct mesh *m) {
     iend = m->cols - 1;
     jend = m->rows - 1;
     
-    y1 = 0.0; /* y1 = m->originy; */
+    y1 = m->originy;
     y2 = y1 + (m->col_step * istep);
     
     for ( i = 0; i < iend; i += istep ) {
-       x1 = 0.0; /* x1 = m->originx; */
+       x1 = m->originx;
        x2 = x1 + (m->row_step * jstep);
        for ( j = 0; j < jend; j += jstep ) {
            z11 = 0.03 * m->mesh_data[j         * m->rows + i        ];
@@ -112,9 +128,13 @@ GLint mesh_to_ogl(struct mesh *m) {
 
 
 /* $Log$
-/* Revision 1.2  1997/05/23 00:35:13  curt
-/* Trying to get fog to work ...
+/* Revision 1.3  1997/05/23 15:40:26  curt
+/* Added GNU copyright headers.
+/* Fog now works!
 /*
+ * Revision 1.2  1997/05/23 00:35:13  curt
+ * Trying to get fog to work ...
+ *
  * Revision 1.1  1997/05/21 15:57:52  curt
  * Renamed due to added GLUT support.
  *