GLInfo & AWTWindowProgram imports with OpenGL - java

I've been set a graphics project as part of a Computer Graphics module, to familiarise myself with the basics of Open GL I've been following some of the tutorials from this website https://sites.google.com/site/justinscsstuff/
At the moment I'm working through a tutorial about rendering methods (https://sites.google.com/site/justinscsstuff/rendering-methods/triangle-scene). In the extended block of sample code for the class 'TriangleScene' there are two imports that I'm a little confused about:
1) support.GLInfo
2) windows.AWTWindowProgram
Eclipse doesn't recognise these automatically - do I need to download further sets of class libraries, as I had to for OpenGL?
I'm just looking to shed some light on these two imports so I can carry on working through the tutorials.

You do need to download these files. You can find them on this page that you mentioned down at the bottom (the first and third files in the list).

Related

TmxMapLoader without libgdx

I'm developing my own game without any frameworks and engines (except JBox2D cause I have very big troubles w/ physics). I need to load .tmx file into my game. The only ready-to-use option was LibGDX with his TmxMapLoader. I added dependency to project, ran and got quite expected crash:
Attempt to invoke interface method 'com.badlogic.gdx.files.FileHandle com.badlogic.gdx.Files.internal(java.lang.String)' on a null object reference at com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver.resolve(InternalFileHandleResolver.java:26)
What I supposed to do to load .tmx from assets using TmxMapLoader?
Probably the best solution would be porting game to LibGDX but I have no time and desire to study documentation and rework that I already have.
If you don't want to use LibGDX framework and its file module, I'd suggest simply going through TMX-related code and convert it the way you want it. LibGDX is open-sourced, after all. FileHandle is just a wrapper over File on most platforms, it should be straightforward to replace (or include in your project and used with File constructor). Java provides its own XML readers, so if it comes to that, you'll be able to replace any XML-related LibGDX code as well.
I'm afraid the default loader implementation loads textures as well, so without running an actual LibGDX application, it will not work. However, if you don't mind including LibGDX jars, you could try extending this class and removing all texture-related code or replacing it with your custom image-loading code.

How to render a 3d cube in LWJGL?

I can`t find a good tutorial on the web, about rendering a 3d cube in the Lightweight Java Game Library! I have been learning LWJGL for some time now. I know how to draw 2d objects. Could Somebody Help me?
Here is a lesson of a tutorial for "normal" OpenGL but in the bottom of the site you can find code for the tutorial lesson in plenty of different languages and libraries, including Java with LWJGL.
To get the java code out of this jar you can open it with e.g. 7-zip and find the .java file in the folder named Lesson05.

use .obj file from blender 2.62+, in java with Eclipse for Android openGL ES

I have looked near and far for a solution to this problem. There seems to be ways to do this using a older version of Blender. I do not want to use an earlier version of Blender, I want to use 2.62.0 and above.
Basically I want to use Blender to create objects to use in my Android applications. I will be using openGL ES in Java. The easier to implement this the better, I am not trying to re-invent the wheel here.
Blend2Java does not work for Blender 2.5+
Java.net seems to be down for maintenance so I cannot find any Java3D resources that will assist
Other 3D Graphics software is just not up to par with Blender and I feel that other software will encounter similar issues
I have also tried min3D and that did not work for me either
An asset pipeline might be nice but at this point I will load image by image if I have to
Could someone please give me some options that will work with blender 2.62 or a run down of the steps that need to be taken to accomplish this. I have decent experience with Java but it is getting to the point where I can no longer keep my sanity.
Last but not least ...
Thank you all here on Stack Overflow and I hope for some good posts as future reference
Are you just looking for an obj loader for android? There are several mentioned here:
Android OpenGL .OBJ file loader

JOGL Navigate Scene with keyboard

I have a program written in Java using JOGL with which you can draw lines with mouse. I now need to be able to navigate within the environment using the keyboard.
The game class code is here;
I have done this kind of thing with Java3D before in which you simply call the KeyNav class ad go from there but I can't seem to find the right functionality in JOGL. Any code, tutorials of information much appreciated.
Here is a link to a project I created. In the example implementation is a small class called Input.java. Just pass your gLAutoDrawable instance in the constructor and it should work.
Link
edit:
Oh, and you need to start the thread. :)

How to do 3d in a Java applet?

I'd like to render a very simple 3D scene in a java applet. I could do all the math myself and render that to a bitmap, but as I'm sure I'm not the first person in history to have to draw a few cubes to the screen, I was wondering how this is usually done.
Every place I've read has said either Java3D or LWJGL, but as I understand it these rely on platform-dependent code and need to be installed separately from Java, making them both unsuitable for graphics.
So how is this usually done?
This old page lists the demos/apps/libraries of 3D Java applets with no hardware dependencies. Unfortunately very few are open-source, others are not even downloadable.
Personally I recommend you to experiment with Java 1.1 3D renderer by Ken Perlin, which has source code available and free to use for academic purposes.
EDIT: jGL is another Java 3D library with no hardware dependencies. It mimics OpenGL 1.* API. It is licensed under GNU Lesser General Public License (LGPL).
In a plug-in 2 JRE (1.6.0_10+), you can use JWS extensions for embedded applets. This is important because JWS makes it much easier to ensure the correct binaries are on the run-time class path. AFAIU JOGL and Java 3D both offer JWS extensions for their APIs.
Should you choose to go that way, please make the applet has the draggable parameter added, so the end user might choose if they want a (mostly useless) browser window wrapped around a 3D animation.
I ran into similar problems when I needed to do some 3d rendering in an applet. My solution was to simply implement from scratch a 3d rendering library in Java. The fear was that it would be a poor performer but on an I5 processor, this proved to not be the case. The added advantage is that I was able to write the library in the way I always wanted graphics to be done. The real advantage,, though, is that it will run regardless of any need to have some graphics library installed on the client and without regard to any graphics card dependencies.
I will gladly share a subset of this code to anyone who wants to look at it.
Could you use JOGL?
http://download.java.net/media/jogl/demos/www/applettest-jnlp.html
I'm not a Java guy, but 2/3 years ago when I was at univeristy I had the same problem :)
I've tried jogl... and for noob in Java like myself I found it too complicated to configure and write something using it.
I used Java3d and it worked like a charm, the only problem I had back then, was that Java3d did not worked with all graphic cards. But fortunatelly it worked with computers at my univeristy :)

Categories

Resources