diff options
author | rodgersgb <[email protected]> | 2006-10-05 00:54:44 +0000 |
---|---|---|
committer | rodgersgb <[email protected]> | 2006-10-05 00:54:44 +0000 |
commit | f0b50339bc4da8167c6bd0f07562285666a45c9e (patch) | |
tree | 2c242124867a09ba784b33b53f20c8f40e19fd79 | |
parent | fe9484e208cb9a4638c71dc3b673c56f1652b850 (diff) |
test
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@23 83d24430-9974-4f80-8418-2cc3294053b9
-rw-r--r-- | src/net/java/joglutils/test3ds/Main.java | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/net/java/joglutils/test3ds/Main.java b/src/net/java/joglutils/test3ds/Main.java index 6b139db..dc201b0 100644 --- a/src/net/java/joglutils/test3ds/Main.java +++ b/src/net/java/joglutils/test3ds/Main.java @@ -1,21 +1,21 @@ /*
* Copyright (c) 2006 Greg Rodgers All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* The names of Greg Rodgers, Sun Microsystems, Inc. or the names of
* contributors may not be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -23,12 +23,12 @@ * SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
- * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF GREG
* RODGERS OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -52,7 +52,7 @@ public class Main { /** Creates a new instance of Main */
public Main() {
}
-
+
public static void main(String[] args)
{
Frame frame = new Frame();
@@ -78,33 +78,33 @@ public class Main { frame.show();
animator.start();
}
-
+
static class Renderer implements GLEventListener
{
private MyModel model = new MyModel();
-
+
public void display(GLAutoDrawable gLDrawable)
{
final GL gl = gLDrawable.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
-
+
gl.glPushMatrix();
gl.glScalef(0.000004f, 0.000004f, 0.000004f);
model.render(gLDrawable);
gl.glPopMatrix();
-
+
gl.glFlush();
}
-
-
+
+
/** Called when the display mode has been changed. <B>!! CURRENTLY UNIMPLEMENTED IN JOGL !!</B>
* @param gLDrawable The GLDrawable object.
* @param modeChanged Indicates if the video mode has changed.
* @param deviceChanged Indicates if the video device has changed.
*/
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
-
+
/** Called by the drawable immediately after the OpenGL context is
* initialized for the first time. Can be used to perform one-time OpenGL
* initialization such as setup of lights and display lists.
@@ -113,18 +113,18 @@ public class Main { public void init(GLAutoDrawable gLDrawable)
{
final GL gl = gLDrawable.getGL();
-
+
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.3f);
gl.glClearDepth(1.0f);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glDepthFunc(GL.GL_LEQUAL);
gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
-
+
if (!model.isLoaded())
model.load(gLDrawable, "globe.3ds");
}
-
-
+
+
/** Called by the drawable during the first repaint after the component has
* been resized. The client can update the viewport and view volume of the
* window appropriately, for example by a call to
@@ -142,7 +142,7 @@ public class Main { {
final GL gl = gLDrawable.getGL();
final GLU glu = new GLU();
-
+
if (height <= 0) // avoid a divide by zero error!
height = 1;
final float h = (float)width / (float)height;
|