Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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 / JInput / Re: Jinput status on: 2006-03-16 13:30:00
I am glad to here that this API isn't dead.

 I don't really need mouse and keyboard support, I am handling them through java's usual event listeners.

I will defenetly try new JInput.

Thanx!
 
2  Java Game APIs & Engines / JInput / Jinput status on: 2006-03-16 09:39:31
Hi,
I am using jinput in my game, but I have serious problems with it. I am trying to detect and use joystick , but a have few  problems. First thing, on linux (Ubuntu Breezy Badger) when I list controllers I got just one controller, which is funny, because I got Keyboard, Mouse and Joystick attached to computer. But the real problem is when I try to find out if this controller is Joystick I cant really do it because getIdentifier for this controller returns Unknown (on windows it returns STICK identifier).  I found out that this is Joystick by the number of axis and buttons, but I think this is very bad way to detect it.

Second problems is with Axes. I can't detect axis right on linux. Here is how I do it:

1  
joystick.getComponent(Identifier.Axis.X)


and I get null. On windows it works OK, I get X Axis.

So , on linux, the only thing I can do is to assume that first axes returned is X, second is Y, and third is Z. I don't feel comfortable with this, because I am not sure if axes are always returned in this order,(on windows I get Z axes first.). getname method returns "X Axes" for all axes !!!!

Ok, now let's switch to windows. On windows, Jinput returns Keyboard, Mouse and Joystick controller, and I can detect Jostick by Identifier, so far everything is OK. Axis are also detected by Identifier: 
1  
2  
3  
joystick.getComponent(Identifier.Axis.X)
joystick.getComponent(Identifier.Axis.Y)
joystick.getComponent(Identifier.Axis.Z)
and it works fine.

The only problem I have on windows are buttons. Once again I can not access desired button by Idenifier, because for every button method getIdentifier returns Unknown. So I must assume that buttons are return in right order form getComponents method of the controller.

With all this said above,  I have serious doubts on using JInput at all. Are there some plans to fix this issues soon?
3  Java Game APIs & Engines / Java Sound & OpenAL / Re: May I ask where to find the latest version of JOAL on: 2006-02-20 20:45:14
Ken,

I downloaded joal for linux  but I get this error:

1  
2  
3  
4  
net.java.games.joal.ALException: java.lang.UnsatisfiedLinkError: /home/igor/javaprojekti/jogl/Gravity/libjoal_native.so: libopenal.so.0: cannot open shared object file: No such file or directory
   at net.java.games.joal.ALFactory.initialize(ALFactory.java:60)
   at net.java.games.joal.ALFactory.getAL(ALFactory.java:71)
   at net.java.games.sound3d.AudioSystem3D.init(AudioSystem3D.java:61)


libopenal.so.0 seems to be missing, I didn't find it i n release build. Can you please provide natives for linux,  thanx in advance.
4  Java Game APIs & Engines / JOGL Development / Re: smooth shading problems on: 2006-02-03 19:10:25
Yes, I just tried it and it works. Thanx for your answer.
5  Java Game APIs & Engines / JOGL Development / Re: smooth shading problems on: 2006-02-03 15:44:04
should I use vertex normals instead of surface normals?
6  Game Development / Game Play & Game Design / shooth shading problems on: 2006-02-03 15:06:48
Can anyone provide a sample code which demonstrates smooth shading on polygonal 3d objects.
I have my 3d object class which contains lists of polygon groups. each polygongroup have color and material properties, and list of Polygon objects. Polygon object contains list of vertices (represented by my Point3d class). It also has normal vector. So now this is how I draw object:

init method:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
           gl.glShadeModel(GL.GL_SMOOTH);
            gl.glClearColor(0, 0, 0, 0);
            gl.glClearDepth(1);
            gl.glEnable(GL.GL_DEPTH_TEST);
            gl.glDepthFunc(GL.GL_LEQUAL);
            gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
            gl.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, lightAmbient);
            gl.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, lightDiffuse);
            gl.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION, lightPosition);
            gl.glEnable(GL.GL_LIGHT1);
            gl.glColorMaterial(GL.GL_FRONT, GL.GL_DIFFUSE);
            gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);




display method:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
        gl.glEnable(GL.GL_LIGHTING);
        gl.glEnable(GL.GL_COLOR_MATERIAL);
     
        for (PolygonGroup polygonGroup : polygonGroups)
        {
            gl.glMaterialfv(GL.GL_FRONT, GL.GL_DIFFUSE, polygonGroup.getDiffuseColor());
            gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, polygonGroup.getSpecularColor());
            gl.glMaterialf(GL.GL_FRONT, GL.GL_SHININESS, polygonGroup.getShinines());
            for (Iterator<Polygon> iter = polygonGroup.getPolygons().iterator(); iter.hasNext();)
            {
                float[] color = polygonGroup.getDiffuseColor();
                Polygon polygon = iter.next();
                gl.glBegin(GL.GL_POLYGON);
                Vector3D n = Math3D.getNormal(polygon);
                gl.glNormal3d(n.x, n.y, n.z);
                gl.glColor4f(color[0], color[1], color[2], 1);
                Point3D[] p = polygon.getPoints();
                for (int i = 0; i < p.length; i++)
                {
                    gl.glVertex3d(p[i].x, p[i].y, p[i].z);
                }
                gl.glEnd();
            }
        }
       


and after that my object looks like this:



what's wrong with this code  Huh
7  Java Game APIs & Engines / JOGL Development / smooth shading problems on: 2006-02-03 10:51:50
Can anyone provide a sample code which demonstrates smooth shading on polygonal 3d objects.
I have my 3d object class which contains lists of polygon groups. each polygongroup have color and material properties, and list of Polygon objects. Polygon object contains list of vertices (represented by my Point3d class). It also has normal vector. So now this is how I draw object:

init method:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
           gl.glShadeModel(GL.GL_SMOOTH);
            gl.glClearColor(0, 0, 0, 0);
            gl.glClearDepth(1);
            gl.glEnable(GL.GL_DEPTH_TEST);
            gl.glDepthFunc(GL.GL_LEQUAL);
            gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
            gl.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, lightAmbient);
            gl.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, lightDiffuse);
            gl.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION, lightPosition);
            gl.glEnable(GL.GL_LIGHT1);
            gl.glColorMaterial(GL.GL_FRONT, GL.GL_DIFFUSE);
            gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);




display method:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
        gl.glEnable(GL.GL_LIGHTING);
        gl.glEnable(GL.GL_COLOR_MATERIAL);
     
        for (PolygonGroup polygonGroup : polygonGroups)
        {
            gl.glMaterialfv(GL.GL_FRONT, GL.GL_DIFFUSE, polygonGroup.getDiffuseColor());
            gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, polygonGroup.getSpecularColor());
            gl.glMaterialf(GL.GL_FRONT, GL.GL_SHININESS, polygonGroup.getShinines());
            for (Iterator<Polygon> iter = polygonGroup.getPolygons().iterator(); iter.hasNext();)
            {
                float[] color = polygonGroup.getDiffuseColor();
                Polygon polygon = iter.next();
                gl.glBegin(GL.GL_POLYGON);
                Vector3D n = Math3D.getNormal(polygon);
                gl.glNormal3d(n.x, n.y, n.z);
                gl.glColor4f(color[0], color[1], color[2], 1);
                Point3D[] p = polygon.getPoints();
                for (int i = 0; i < p.length; i++)
                {
                    gl.glVertex3d(p[i].x, p[i].y, p[i].z);
                }
                gl.glEnd();
            }
        }
       


and after that my object looks like this:



what's wrong with this code  Huh
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: sound3d package status on: 2006-01-31 10:20:54

Quote
Agreed that it's a cleaner, more object-oriented API. If you have suggestions for how to improve the API please post them.

For now I don't have suggestions, It is really good and simple.
I am bit confused with versions, because I recently downloaded joal1.1b0.4, but now I see joal1.1b01 as latest release...
Another thing that bothers me is that javadoc for joal1.1b0.1 doesn't contain sound3d package doc. Why is that so?
9  Java Game APIs & Engines / Java Sound & OpenAL / Re: sound3d package status on: 2006-01-30 16:43:06
Hi, Ken, thanx for your help.

I made my code work in another way. i just added ALut.alutInit() after  AudioSystem3D.init(); and it works  now. Which way is right way, my or yours?

My code was actually inside of class constructor and that class extends JFrame, so my program wasn't really exiting untill I close the window.

I foud sound3d package very helpfull and much cleaner designed for use in java apps.

as java programer I  prefer calling methods like   AudioSystem3D.getListener().setPosition(0, 0, 0);  then AL10.alListener(AL10.AL_POSITION, listenerPosition);

I think that is the direction in wich you should go with joal development. If I can help i n any way I would be glad.
10  Java Game APIs & Engines / Java Sound & OpenAL / sound3d package status on: 2006-01-29 15:52:02
Hi,
I downloaded latest joal release so I found that it has sound3d package. I love its architecture, it is much more object oriented and "java style", so I hoped I could use it in my game. But, it just doesn't work.
this is the code:

try
        {
            AudioSystem3D.init();
            AudioSystem3D.generateBuffers(1);
            AudioSystem3D.generateSources(1);
            Buffer buff = AudioSystem3D.loadBuffer("data/audio/Explode.wav");
            Source source = AudioSystem3D.generateSource(buff);
            source.setPosition(0, 0, 0);
            AudioSystem3D.getListener().setPosition(0, 0, 0);
            source.setMaxDistance(100);
            source.play();
        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }


it doesnt rise exception, it just doesnt play anything.  file is defenetly there and it works good with lwjgl's joal wrapper.

One another thing bothers me. In joal windows binaries there is joal.jar and joal.dll, but without OpenAL.dll (from lwjgl libraries) it rises exception: net.java.games.joal.OpenALException: Could not load openal library.

So my questions are:

1. what is the status of net.java.games.sound3d package
2. what's wrong with my code above
3. which dll's I need to use joal
11  Java Game APIs & Engines / JOGL Development / Re: jogl 1.1.1 poor performance on: 2006-01-27 16:50:14
So, Ken, you claim that if I upgrade my app to jsr 231 release, it will run as fast as with old jogl or better ?
How stabile is new release?
12  Java Game APIs & Engines / JOGL Development / Re: jogl 1.1.1 poor performance on: 2006-01-25 16:19:07
cylab, why should I get software rendering with jogl 1.1.1 but not with old jogl ? my code is same. I use default GLCapabilities.
13  Java Game APIs & Engines / JOGL Development / jogl 1.1.1 poor performance on: 2006-01-24 11:02:56
I used old jogb binaries, from 2003. my game works fine with it. Then I decided to switch to latest jogl release, and I was surprised with much worse performance. Why is this ? shouldn't newer release perform better?
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.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (26 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (13 views)
2014-07-29 10:59:34

E.R. Fleming (34 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (44 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

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
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!