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.
|
|
|
|
|
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 
|
|
|
|
|
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 
|
|
|
|
|
8
|
Java Game APIs & Engines / Java Sound & OpenAL / Re: sound3d package status
|
on: 2006-01-31 10:20:54
|
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
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|