*
* 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)
**************************************************************************/
/* $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.
*
*
* 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)
**************************************************************************/
/* $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.
*
*
* 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)
**************************************************************************/
/* $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.
*
*
* 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)
**************************************************************************/
/* $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.
*
*
* 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)
**************************************************************************/
/* 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() {
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);
GLint make_mesh() {
GLint mesh;
- mesh = mesh_to_ogl(mesh_ptr);
+ mesh = mesh2GL(mesh_ptr);
return(mesh);
}
/* 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);
/* Tell GL we are switching to model view parameters */
glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ /* glLoadIdentity(); */
/* draw terrain mesh */
draw_mesh();
/* 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 */
/* $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.
*
#
# 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)
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# $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 ...
#
*
* 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)
**************************************************************************/
/* 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 }; */
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);
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 ];
/* $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.
*