jogl

Texture size when using JOGL

In my next project, I'm trying to learn JOGL. The result should be a simple 2d animation. I've heard, that a texture must be 2^n*2^n in size. Can I still use images which don't have this size, or do I have to edit all images in advance? What do I have to take care of, when using such textures? As an example, I want to show a kind of pr...

Mixing Swing GUI components and JOGL

How does one go about adding JButtons among various other Swing GUI components inside a JOGL canvas? Is it even possible? Is it practical? If it is not possible/practical/feasible how would you go about programming your own GUI components that work in JOGL? ...

Writing cross-platforms application with a complex GUI

Hi! I'd like develop an application with a complex GUI (combobox with animation, charts with spline, transparent layers, ...). I've good experience with C# 2.0 and I'm studying WPF, but unfortunately I read that there is no plan to port WPF on Mono. I was thinking about creating my custom GUI control using OpenGL (with OpenTK)... But I...

How to bundle JOGL with NetBeans Platform?

I was going to use both JOGL and NetBeans platform. I have trouble embedding JOGL native libs. Maybe there is a simple way to reuse .nbms from NetBeans OpenGL Plugin? Or any other way to do this? ...

GLCanvas and other JOGL classes missing from NetBeans OpenGL Pack?

Hey, I'm have horrendous problems trying to get a JOGL program compiling using Netbeans 6.9. I can't seem to find an up to date explanation as to how to do this. When I install the NetBeans OpenGL pack I can't compile the examples. I get a compile error stating it can't find some methods such as GLCanvas(). When I go to the library to s...

How do I distribute a JOGL application?

Hi, I've written an application the builds fine on my machine but when I move it to another machine the dependent JOGL libraries cannot be found. Is it possible to create a build that sets up all the required JOGL files so that you can distribute your Java application with the necessary JOGL libraries? If someone could explain this in...

Deallocating Direct Buffer Native Memory in Java for JOGL

Hello there, I am using direct buffers (java.nio) to store vertex information for JOGL. These buffers are large, and they are replaced several times during the application life. The memory is not deallocated in time and I am running out of memory after a few replacements. It seems that there is not good way to deallocate using java.n...

How to make JOGL 2.0 work with SWT?

I'm trying to get SWT working with the newest JOGL (2.0). I tried SWT snippet 209, but it doesn't work. The problem is caused by the following line: final GLContext context = GLDrawableFactory.getFactory().createExternalGLContext(); ...but when I change getFactory() to getFactory(GLProfile.getDefault()) (to make it compatible with th...

Revisiting the issue of LWJGL vs JOGL for game programming

There exists the question, "Java Game Programming: JOGL vs LWJGL?" but it's not exactly what I'm looking for, and it's over a year old (in which time JOGL has gone through some changes) so I'd like to revisit this issue... I have been studying game development with a focus on Java. I've worked on some little projects with JOGL, but late...

Java OpenGL blending image colors

I'm trying to blend 2 images together in the following way: Image 1 should be drawn as the base image. Image 2 should be drawn overtop of image 1. Anywhere image 2 is non-transparent, it should replace the contents of image 1 (not blend, but overwrite what is there). Wherever image 2 is transparent, image 1 should show through. I've tri...

Physics with JOGL (Java, OpenGL)

I'm doing a little project to teach myself about JOGL. Some of my ideas would be easier with a physics engine. Is there a 3D physics engine that's particularly good, or is commonly used with JOGL? ...

.3ds with JOGL?

I would like to use .3ds models with JOGL. How can I do this? How can I import other file formats, like .max or .obj? Thanks. I'm new to OpenGL and JOGL. ...

Load a .obj file with Java3D and use it in JOGL?

I'm using Java3D and JOGL, but I'm having a hard time figuring out how to do this by looking at the javadocs. I want to load a .obj file (other formats would be nice, too) and render it using JOGL. Here's a loader class. It returns a Scene from a filename. How can I use this Scene in JOGL? Thanks. I'm new to JOGL and Java3D. ...

OpenGL: Model not displaying correctly. (Need to fix draw distance?)

I'm new to OpenGL. I'm playing around with JOGL. I have a .obj model that I'm drawing as polygons. It looks ok, except that most of it gets clipped. So I think that I need to increase the draw distance. I'm not really sure how to do it. Here is my render code: private void render(GLAutoDrawable drawable) { GL2 gl = drawable.ge...

[JOGL] Rotating text using Textrenderer

Hey, I'd like to display text in a 2D szenario using JOGL. But I can't figure out, how to rotate text using com.sun.opengl.util.j2d.TextRenderer. It does not have any methods concerning the rotation. So I was expecting the modelview matrix to have an effect on the rotation. val renderer = new TextRenderer(new Font("SansSerif", Font.BOLD...

OpenGL: Set position instead of translating?

Can I set the current render position to be an arbitrary value, instead of just giving it an offset from the current location? This is what I'm doing currently: gl.glTranslatef(3.0f, 0.0f, 2.0f); It allows me to say "I want to move left" but not "I want to move to point (2, 1, 2)". Is there a way to do the latter? I'm using OpenGL w...

Parsing .obj files: How to do materials/textures?

Hello, I'm new to OpenGL. I'm playing around with it using JOGL. I'm using this model. I am successfully rendering it to the window. However, I would like to apply textures/materials. I'm not entirely sure how to do this. From the .obj file: f 6307/4525/3 6303/4524/3 6327/4523/3 6315/4526/3 usemtl kahki_light_pave_W.png f 6445/3470/3...

OpenGL: Choose which poly face is forwards?

I'm new to OpenGL. I'm using Java/JOGL. I'm having difficulty with polygon faces. I want to be able to control which side is the front or back. I've been working through this documentation. I thought this line of code, in my display() method, would make all poly faces be drawn, but it had no effect: gl.glPolygonMode(GL.GL_FRONT_AND_BA...

Java: BufferUtil?

I'm trying to use this class with JOGL. It references BufferUtil, which I can't find anywhere. I found documentation, but no actual code. Eclipse doesn't suggest to import it from anywhere. What do I have to do to be able to use this code? ...

Suggested framework for generic 3D demo software

Hi everyone, My company has decided that we need a "generic" demo infrastructure for our technology demos, given that I can write this using JOGL or OpenGL and create my own framework, I'd hate to reinvent the wheel. But there are so many 3D gfx engines out there and so many OpenGL wrappers! Basically, we want to use 3D graphics to re...