Show Posts
|
|
Pages: [1] 2 3
|
|
2
|
Java Game APIs & Engines / JOGL Development / Re: WebStart and Method "glBindBuffer" not available
|
on: 2007-12-04 22:27:31
|
I wrote a small program to query the available functions via the JOGL API and I get: 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 26 27
| Functions:
OpenGL 1.5 glBeginQuery: true glBindBuffer: true glBufferData: true glBufferSubData: true glDeleteBuffers: true glDeleteQueries: true glEndQuery: true glGenBuffers: true glGenQueries: true glGetBufferParameteriv: true glGetBufferPointerv: true glGetBufferSubData: true glGetQueryObjectiv: true glGetQueryObjectuiv: true glGetQueryiv: true glIsBuffer: true glIsQuery: true glMapBuffer: true glUnmapBuffer: true
Extensions:
OpenGL 1.5 GL_ARB_vertex_buffer_object: true |
This is odd, since it differs from the 'glview' tool's results, suggesting that the driver does support the 1.5 functions, but when TextRenderer calls glBindBuffer() I get the aforementioned exception. Not too sure what to make of this. This is problematic, since this means I can't check for the presence of the function and assume that it is really there when it is confirmed as being supported. I should note that my test tool indicates no 2.0 support, so it looks like it working correctly (Intel indicates the driver support up to OpenGL 1.5). As for the extension I only checked for 'GL_ARB_vertex_buffer_object'.
|
|
|
|
|
5
|
Java Game APIs & Engines / JOGL Development / Re: WebStart and Method "glBindBuffer" not available
|
on: 2007-12-03 19:52:22
|
Thanks, though I do have one question: While I will add extra checks, should this really be TextRenderer taking care of not calling extenstions & features not supported by the current OpenGL implementation? Edit: I have now ensured that the OpenGL support is indeed 1.5, and that GL_ARB_vertex_buffer_object is present, on the PC after updating the drivers, and verified with: http://www.realtech-vr.com/glview/I am still getting the same exception. The output from the tool is: http://ajmas.dyndns.org/misc/glview-Intel965.xmlEdit: I misread the results, while GL_ARB_vertex_buffer_object is present, glBindBuffer is not supported and nor are any of the OpenGL 1.5 specific functions. I am not sure how Intel can claim their driver to 1.5 compliant? In this case looks like I need to add gl.isFunctionAvailable("");
|
|
|
|
|
7
|
Java Game APIs & Engines / JOGL Development / Re: Limiting FPS
|
on: 2007-12-03 16:56:24
|
The examples I have seen suggested adding a sleep help reduce the frame rate. Something like the following, if you are using a GLCanvas with a main loop: 1 2 3 4 5 6 7 8 9 10 11
| public void run() { while ( this.run ) { repaint(0); try { Thread.sleep(30); } catch ( InteruptedException ex ) { } }
} |
|
|
|
|
|
8
|
Java Game APIs & Engines / JOGL Development / WebStart and Method "glBindBuffer" not available
|
on: 2007-12-03 16:45:08
|
I have been developing a small application in JOGL, which works without any issues on my MacOS X 10.5 based machine, but fails when I try running it from my Windows XP machine. Can anyone suggest what I am doing wrong? It is being launched via WebStart (JNLP): http://ajmas.dyndns.org/jnlp/Tetris3D.jnlpthe excpetion I am getting is below: 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
| Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Method "glBindBuffer" not available at com.sun.opengl.impl.GLImpl.glBindBuffer(GLImpl.java:373) at com.sun.opengl.util.j2d.TextRenderer.endRendering(TextRenderer.java:861) at com.sun.opengl.util.j2d.TextRenderer.endRendering(TextRenderer.java:708) at ajmas74.tetris3d.Tetris3D.drawStatusPanes(Tetris3D.java:339) at ajmas74.tetris3d.Tetris3D.display(Tetris3D.java:192) at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78) at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:435) at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194) at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412) at javax.media.opengl.GLCanvas.display(GLCanvas.java:244) at javax.media.opengl.GLCanvas.paint(GLCanvas.java:277) at javax.media.opengl.GLCanvas.update(GLCanvas.java:354) at sun.awt.RepaintArea.updateComponent(Unknown Source) at sun.awt.RepaintArea.paint(Unknown Source) at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) |
|
|
|
|
|
10
|
Java Game APIs & Engines / JOGL Development / Transparent canvas?
|
on: 2007-11-12 17:52:00
|
|
I remember reading some time back that it was possible to make the GLCanvas transparent in such a way to see the desktop behind, in MacOS X. I haven`t been able to refind the documentation on this. Does anyone know about this and can tell me what I need to do to achieve this?
|
|
|
|
|
11
|
Java Game APIs & Engines / JOGL Development / Re: JOGL OSX and eclipse
|
on: 2007-11-12 17:22:04
|
|
If you are going to be running your development projects from within Eclipse, then what you need to do is to put the native libraries in the base of your project and then add the jars to the project. The other alternative location is ~/Library/Java/Extensions. Both will do the job.
|
|
|
|
|
12
|
Java Game APIs & Engines / JOGL Development / [Q] Status Panel and 3D scene
|
on: 2007-11-09 06:30:10
|
|
I am wanting to display a 3D scene and then have a status panel in front of it. As an example imagine a game like Warcraft where there is a 3D area and then a 2D area for the status of health, etc. One approach I could use is to have two panels: the GLCanvas and in front of it a semi transparent Panel withe what I need, or go whole hog with JOGL in the GLCanvas. I haven't tried either but I would certainly be interested to find a solution where everything can be done in OpenGL. The main issue I am worrying about is not having 3D objects move through the status panel. Any suggestions?
|
|
|
|
|
13
|
Java Game APIs & Engines / JInput / 3D Input devices & Jinput
|
on: 2007-11-08 18:29:49
|
I was in the process of designing and research an API for 3D input devices, when I came across JInput and thought maybe working with this project would be energy better spent. For me a 3D input device is anything that offers more detailed input than the X/Y data provided by a mouse. The type of input I imagine are: - x/y/z acceleration - x/y/z positioning - pitch/roll/yaw Of course not all devices will support all input, so means of knowing what device class, along with the type of input it can provided would have to be taken into consideration. In some cases the characteristics of the device can change depending on the state of the device. Some 3D input devices I am thinking of include: - 3dconnexion's space mouse: http://www.3dconnexion.com/3dmouse/spaceexplorer.php - Wii Remote & the associated Nunchuk: http://wii.nintendo.com/controller.jsp - Some others: http://www.vrealities.com/control.htmlIn a number of cases the implementations for a specific device would probably have to reply on JNI, given that exact communication protocols aren't always available, as in the case of 3dconnexion, but in other cases there are Java API available, as in the case of WiiremoteJ. Would extending Jinput for these type of devices be of interest to anyone?
|
|
|
|
|
14
|
Java Game APIs & Engines / JOGL Development / Re: Problems by JOGL in NetBeans 6
|
on: 2007-11-03 21:19:08
|
A java.lang.NoClassDefFoundError usually indicates that a class can't bound or one of its dependencies is is missing. From the Javadoc: "Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.
The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found. " The best way to work out what is going wrong is to look at the stack trace. The oldest call is at the bottom and the most recent on the top. This first thing to check is whether your CLASSPATH contains the JAR which contains the class and then to see whether they of the right version. Edit: Looking at the following thread would suggest a conflict in JOGL versions. Maybe you compiled with one version and are attempting to run with another, incompatible version: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1193238872
|
|
|
|
|
15
|
Java Game APIs & Engines / JOGL Development / Status of com.sun.opengl classes?
|
on: 2007-11-03 17:19:03
|
|
From what I have read 'com.sun' classes should be treated as classes which may have their API change at any time, without respect for backwards compatibility, and therefore should be avoid where possible. Does the same go for the 'com.sun.opengl' classes? Will these be migrated to javax at some point in time?
|
|
|
|
|
16
|
Java Game APIs & Engines / JOGL Development / Re: problem about skybox -- looking for help
|
on: 2007-11-03 16:48:56
|
Looking at your code, I wonder whether using GLEventListener would be better, since it calls you at the approriate times. For example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| class MyClass extends GLCanvas implements GLEventListener, Runnable {
MyClass () { addGLEventListener(this); }
public void run () { while ( true ) { this.repaint(); try { Thread.sleep(100); } catch (InterruptedException e) { } } } } |
The code in the run method is only necessary if you need to implement code that needs to happen, without user interaction. Some other observations, is that you sky texture is going to be repeated and not stretched: 0.0 - 1.0, is the extent of the texture and anything beyond that will cause it to repeat. So, 0.0 - 2.0 will cause the texture to be repeated twice. I also noticed in my tests that anything beyond -50, on the z-axis, resulted in cropping during the rotation (I am tried grafting your code onto a skeleton I use for tests). I am not an expert in OpenGL myself, so I am not sure why this is the case.
|
|
|
|
|
18
|
Java Game APIs & Engines / JOGL Development / Text display issue in ported code - help needed
|
on: 2007-11-02 20:57:55
|
I am in the process of porting some OpenGL code, written in C/C++, to Java, but my inexperience with text display is causing me problems. The relavent C/C++ code is as follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| void TextOut(double x, double y, double size, char *str, bool ident) { gl.glMatrixMode(GL.GL_MODELVIEW); gl.glPushMatrix();
if (ident) gl.glLoadIdentity();
gl.glColor3d(1,1,1); gl.glTranslatef(x,y,0); gl.glScalef(size, size, size); QFont fnt; fnt.setPointSize(size*2); renderText(1, 0, 0, str, fnt);
gl.glPopMatrix(); } |
the class in which this is implemented extends QGLWidget. and so far I have come up with: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| void textOut(GL gl, double x, double y, double size, String str, boolean ident) { gl.glMatrixMode(GL.GL_MODELVIEW); gl.glPushMatrix();
if (ident) { gl.glLoadIdentity(); } gl.glColor3d(1,1,1); gl.glTranslated(x,y,0); gl.glScaled(size, size, size); gl.glRasterPos2d(0,0); int fontId = GLUT.BITMAP_HELVETICA_10; glut.glutBitmapString(fontId, str);
gl.glPopMatrix(); } |
While it does the job more or less, am finding that I am getting alignment issues depending on the size of the window I am using. Any ideas as to what I should be doing? Also are there any good routines for rendering any font in OpenGL, including True Type fonts?
|
|
|
|
|
19
|
Java Game APIs & Engines / JOGL Development / Wireframe and non-Wireframe in same scene?
|
on: 2007-10-31 15:43:40
|
I am wanting to draw an image of the Earth on a sphere and then overlay it with the longitude and latitude lines. I thought this would do the job: 1 2 3 4 5 6 7 8 9
| gl.glPolygonMode(GL.GL_FRONT, GL.GL_FILL); OpenGlUtils.drawSphere ( gl, null,2.0, 80); gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE); gl.glBindTexture(GL.GL_TEXTURE_2D, textureIds[2]); OpenGlUtils.drawSphere ( gl, null,2.01, 20); |
but it would seem that glPolygonMode is global for a given display cycle. Are there other approaches that someone could recommend?
|
|
|
|
|
21
|
Java Game APIs & Engines / JOGL Development / Re: jogl and SWT
|
on: 2007-10-28 02:24:33
|
|
JOGL is a pure abstraction of the native OpenGL API, as such there should be hardly any dependencies on AWT, if any. I recommend the best thing to do is look at the source to reassure yourself.
|
|
|
|
|
23
|
Java Game APIs & Engines / JOGL Development / Applying a texture to a sphere, using QUAD_STRIPS
|
on: 2007-10-27 23:57:19
|
I have a method for drawing a sphere: 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| static public void drawSphere(GL gl, double radius, int lats, int longs) { gl.glEnable(GL.GL_TEXTURE_GEN_S); gl.glEnable(GL.GL_TEXTURE_GEN_T);
for ( int i = 0; i <= lats; i++) { double lat0 = Math.PI * (-0.5 + (double) (i - 1) / lats); double z0 = Math.sin(lat0) * radius; double zr0 = Math.cos(lat0) * radius;
double lat1 = Math.PI * (-0.5 + (double) i / lats); double z1 = Math.sin(lat1) * radius; double zr1 = Math.cos(lat1) * radius;
gl.glBegin(GL.GL_QUAD_STRIP); for ( int j = 0; j <= longs; j++) { double lng = 2 * Math.PI * (double) (j - 1) / longs; double x = Math.cos(lng) *radius; double y = Math.sin(lng) *radius; gl.glNormal3d(x * zr0, y * zr0, z0); gl.glVertex3d(x * zr0, y * zr0, z0); gl.glNormal3d(x * zr1, y * zr1, z1); gl.glVertex3d(x * zr1, y * zr1, z1); } gl.glEnd(); }
gl.glDisable(GL.GL_TEXTURE_GEN_S); gl. glDisable(GL.GL_TEXTURE_GEN_T); } |
I now want to modify this to allow for applying a texture around the globe. If I had split the sphere into QUADs, then I would probably have applied the texture as a percentage of the rotation, but I am not sure how I would do this with a quad strip? I would like the texture to wrap around the object, like a map around a globe, rather than repeat.
|
|
|
|
|
24
|
Java Game APIs & Engines / JOGL Development / How to apply super large texture?
|
on: 2007-10-27 22:54:52
|
|
I am fairly new to JOGL, and while I have already applied to basic textures to an object, I am not sure how I would go about applying a 'super large' texture. For example, if I had a globe, a bit like Google Earth how would I apply the texture at default magnification? Also, what are the size limitations that I should take into account, if any?
|
|
|
|
|
26
|
Java Game APIs & Engines / JOGL Development / 3D widget in HUD?
|
on: 2005-12-15 23:24:12
|
|
I am in the process of writing a program that provides a view of a virtual world. In front of th viewer's view is a HUD, where I wish to add a few 3D widgets, that would be updated in real time. I don't want the 3D widgets on the HUD to be affected by the perspective used to display the 3D world. Do you have any ideas on how to do ensure the perspectives are different for the world and the HUD?
|
|
|
|
|
27
|
Java Game APIs & Engines / JOGL Development / Re: Texture enabled and darkened lines
|
on: 2005-11-25 21:33:34
|
|
Looks like I misunderstood. I thought that enabling or displaying a feature applied to the whole 'display' phase. This corrects the issue.
Also made another in my code whereby I was using
gl.glPolygonMode(GL.GL_FRONT,GL.GL_LINE);
and forgot to change it to
gl.glPolygonMode(GL.GL_FRONT,GL.GL_FILL);
for when doing the texture, so I wasn't seeing the texture. Sharing for the benefit of others.
|
|
|
|
|
28
|
Java Game APIs & Engines / JOGL Development / Texture enabled and darkened lines
|
on: 2005-11-25 20:22:45
|
|
I have been creating a program that uses polygons fairly heavily. I then decided to add a texture to the background and enabled texturing. When I do this all the lines making up my polygons suddenly darken.
Is there anyway to have dull brightness lines and a texture, without having to manually add lighting? In fact when I add lighting I can't see any of the polgon lines. Any ideas?
|
|
|
|
|
30
|
Java Game APIs & Engines / JOGL Development / Re: rotating an object around a abitrary point
|
on: 2005-11-24 20:16:28
|
|
Are you transforming and then rotating or rotating and then transforming. You'll find that the order in which you need to do things should be in the reverse of what you expect. For example if you are rotating an arrow arround a circle, so it acts like a compass point, then you need to rotate and then transform. I had read about this but it didn't hit me until I actually was doing this on my own (I had forgotten about that fact).
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|