Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (105)
games submitted by our members
Games in WIP (524)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: gluLookAt not working on: 2004-09-29 12:48:57
Quote
As for seeing only a black screen, its?Vc?VV? rid of the box as its two far away. What is your code for the reshape method. You should have something like:

glu.gluPerspective(40.0f, (width/height), 1.0, 200.0);

where 200 is the culling distance. Your code worked OK for me :).


My reshape method had been empty (and I hadn't been reshaping the window).  I tried yours, and I tried reshaping - still black.

...Oh!  I found Angel's reshape method, here it is:

   public void reshape(GLDrawable drawable, int x, int y, int width, int height)    {
                 gl.glViewPort(0, 0, width, height);
       gl.glMatrixMode(GL.GL_PROJECTION);
       gl.glLoadIdentity();
                 gl.glOrtho(-4.0f, 4.0f, -4.0f, 4.0f, -4.0f, 4.0f);        
   }

PROBLEM:  glViewPort doesn't seem to exist in jogl.  Or where is it?
2  Java Game APIs & Engines / JOGL Development / gluLookAt not working on: 2004-09-28 23:16:14
I'm learning OpenGL principles from Edward Angel's book, "OpenGL: A Primer", translating from C into Java/jogl as I go.  His first example for working with the camera looks like:

void display() {
 glClear(GL_COLOR_BUFFER_BIT);
 glMatrixMode(GL_MODELVIEW);
 glLoadIdentity();
 gluLookAt(1.0, 1.0, 1.0,        0.0, 0.0, 0.0,   0.0, 1.0, 0.0);
 glutWireCube(0.5);
 glutSwapBuffers();
}

Here's my translation:

   public void display(GLDrawable drawable) {
       gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT );
       gl.glMatrixMode(GL.GL_MODELVIEW);
       gl.glLoadIdentity();
     
                 glu.gluLookAt(1.0, 1.0, 1.0, //eye
                                  0.0, 0.0, 0.0,  //object
                                  0.0, 1.0, 0.0); //up

       glut.glutWireCube(gl, 0.5f);
       gl.glFlush();
   }

In fact, I'm getting a black screen.  No image.  Although I can get images in other 3D examples, where I'm not using gluLookAt.  Where could I be going wrong?  BTW, is there a jogl equivalent for   glutSwapBuffers()?   It certainly doesn't seem to be in the GLUT interface.

My init code is below, in case that's the issue:

public void init(GLDrawable drawable) {
           this.gl = drawable.getGL();
           this.glDrawable = drawable;

           drawable.setGL( new DebugGL(drawable.getGL() ));
           glu = drawable.getGLU();
           drawable.addMouseListener(this);
           drawable.addMouseMotionListener(this);

     float pos[] = { 20.0f, 5.0f, 10.0f, 0.0f };
     gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
     gl.glEnable(GL.GL_CULL_FACE);
     gl.glEnable(GL.GL_LIGHTING);
     gl.glEnable(GL.GL_LIGHT0);
     gl.glEnable(GL.GL_DEPTH_TEST);
     
     gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
     gl.glColor3d(1.0, 1.0, 1.0);
}
3  Java Game APIs & Engines / JOGL Development / Re: How to: Getting started with JOGL on: 2004-09-15 11:28:22
Please help a newbie out.  You said:

Java loads native libraries from the directories listed in the java.library.path environment variable. Best to just print this out and put the native library into one of these directories.

I tried:

System.out.println(java.library.path);

I got:

Error   : Undefined variable, class, or package name: java
Hello1.java line 15      System.out.println(java.library.path);

What was I really supposed to do?

running CodeWarrior Learning Edition 4, macosx 10.3.5
4  Java Game APIs & Engines / JOGL Development / Re: It still thinks CLASSPATH is set on: 2004-09-09 14:35:07
Thanks, Mithrandir, that did it!

Now it built - with a scary number of warning messages.  Am I to assume life is okay and go on?

Here's a sample:

   [antlr] warning: rule HeaderParser.typeQualifier has different signature than GnuCTreeParser.typeQualifier
   [antlr] warning: rule HeaderParser.typeSpecifier has different signature than GnuCTreeParser.typeSpecifier
   [antlr] warning: rule HeaderParser.typedefName has different signature than GnuCTreeParser.typedefName
   [antlr] warning: rule HeaderParser.structSpecifier has different signature than GnuCTreeParser.structSpecifier

[gluegen] WARNING: "APIENTRY" redefined from "" to ""
 [gluegen] WARNING: skipping emission of unnamed struct "struct __GLXcontextRec"
 [gluegen] WARNING: skipping emission of unnamed struct "struct __GLXFBConfigRec"
 [gluegen] WARNING: skipping emission of unnamed struct "struct _handle"
    [echo] Generating JAWT interface class
    [echo] java.home.dir=/System/Library/Frameworks/JavaVM.framework/Home
 [gluegen] WARNING: Complicated fields (field "JNIEnv *  env;" of type "JAWT_DrawingSurface") not implemented yet
 [gluegen] WARNING: Complicated fields (field "jobject target;" of type "JAWT_DrawingSurface") not implemented yet
 [gluegen] WARNING: No capacity specified for java.nio.Buffer return value for function "java.nio.ByteBuffer GetDrawingSurfaceInfo()"; assuming size of equivalent C return type (32 bytes): java.nio.ByteBuffer GetDrawingSurfaceInfo()
 [gluegen] WARNING: Complicated fields (field "JAWT_DrawingSurface *  ds;" of type "JAWT_DrawingSurfaceInfo") not implemented yet
 [gluegen] WARNING: Complicated fields (field "JAWT_Rectangle *  clip;" of type "JAWT_DrawingSurfaceInfo") not implemented yet
 [gluegen] WARNING: skipping emission of unnamed struct "struct _jobject"
5  Java Game APIs & Engines / JOGL Development / It still thinks CLASSPATH is set on: 2004-09-08 21:58:45
I'm a beginner, trying to get this thing up and running on MacOS X.

Followed this instruction:
     Unset your CLASSPATH environment variable:
The Ant build requires that the Jogl jars not be visible on the classpath. On Unix, type unsetenv CLASSPATH into a csh or tcsh shell, or set CLASSPATH=; export CLASSPATH into a Bourne shell. On Windows, type set CLASSPATH= into a command prompt.
4.

Since I'm running bash, I did CLASSPATH=; export CLASSPATH
yes, very explicitly, very carefully.  Invoked the build from the very next line:

Leilani:~/Programs/java/jogl/make ken$ set CLASSPATH=; export CLASSPATH
Leilani:~/Programs/java/jogl/make ken$ ant macosx

But still I got the message:

BUILD FAILED
/Users/ken/Programs/Java/jogl/make/build.xml:356: The following error occurred while executing this line:
/Users/ken/Programs/Java/jogl/make/validate-properties.xml:55: ******************************************************************
   ** Your CLASSPATH environment variable appears to be set (some  **
   ** JOGL classes are currently visible to the build.) This can   **
   ** cause the build to fail. Please unset your CLASSPATH         **
   ** variable and restart the build.                              **
   ******************************************************************


1. How do I tame this thing?
2. Should I be downloading the built binary instead of building it?
3. If so, where should I put jogl.jar on a vanilla Panther installation?

Using:  apache-ant-1.6.2, antlr-2.7.4, MacOS 10.3.5
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

SHC (21 views)
2014-07-12 17:50:04

Riven (30 views)
2014-07-10 20:20:18

CopyableCougar4 (29 views)
2014-07-10 02:26:14

CopyableCougar4 (32 views)
2014-07-09 02:55:38

Code Mage (33 views)
2014-07-08 23:57:00

Code Mage (20 views)
2014-07-08 23:49:08

AppleSauce (28 views)
2014-07-08 19:25:32

CopyableCougar4 (28 views)
2014-07-06 01:51:26

ipe369 (35 views)
2014-07-05 14:18:25

vastrolorde (44 views)
2014-07-04 18:45:44
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!