Java advice

Soldato
Joined
22 Oct 2005
Posts
2,883
Location
Moving...
Hi guys, i'm after a bit of advice for my dissertation project. I've posted something similar before but now I've got a bit of a better of idea of what I need. Basically I want to create something similar to google earth, you will pass the appplication the longitude and latitude of a point, then it will draw the surroundings of that point in a simlar fashion to google earth, then you will have the options to rotate the camera and zoom in and out (but obviously not as close in), and obviously the whole thing will not be as detailed. I have got the data I require; a list of positions defined by their longitude and latitude and the elevation at the point. So basically I need to just plot all these points, and add some kind of texturing to make it easier to understand, i.e. green = sea level, yellow/brown = high elevation.

So my actual question is what would be the best tool for acheiving this using Java? There's the existing Java 2D API, but I think this lacks the complexity I may require (however if it doesn't this would probably be perfect), and a couple of people on here suggested OpenGL and the accompaning "The RedBook", and another suggested jogl 3D Java.

Does anyone have an opinion on either of these 3 or any other tools I could use? The main thing I'm looking for is it to be as simple as possible, and to have a book/guide that I could teach myself from.

Thanks very much for any advice
 
JOGL is openGL. Your choices are:

Java 2D
Java 3D (awful in my opinion)
JOGL (openGL accessed from Java)

As I suggested in your last thread, openGL is awesome for this kind of thing. It provides loads of nice methods like glRotate, glScale and gluLookAt which make it fairly trivial to control the camera and how you are viewing the world.
 
I to would recommend openGL. I have never used it in Java before but i have in C++ and as Lagz said it contains a lot of methods that will be very useful for you.
 
Ok thanks for that. Is the "RedBook" a good book to learn the ins and outs of openGL? Bearing in mind I need it to start at a fairly basic level and it shouldn't need to go too in depth (hopefully).

Is there any other books/tutorials etc I should bear in mind? Thanks again.

*edit* - also, is the book based on using java? Or does it not really matter because openGL is 'standalone'?
 
Last edited:
Ok thanks for that. Is the "RedBook" a good book to learn the ins and outs of openGL? Bearing in mind I need it to start at a fairly basic level and it shouldn't need to go too in depth (hopefully).

Is there any other books/tutorials etc I should bear in mind? Thanks again.

*edit* - also, is the book based on using java? Or does it not really matter because openGL is 'standalone'?

- The book isn't based on using java, its based on C. JOGL is just some java bindings into the openGL C library. Its trivial to convert between the two. Essentially if the book says to call glDoSomething, in JOGL you would call the glDoSomething method on an object of type GL. Converting C code like some for loops into Java is trivial.
- You would need to look at how to set up JOGL. Its probably best just to get some demo/tutorial code and adapt it (see point 4)
- The book is suitable for beginners, although knowledge of matrix algebra is more or less assumed
- http://nehe.gamedev.net/ has a brilliant set of openGL tutorials, nearly all of which have been ported to JOGL (you can download the JOGL versions at the bottom of each tutorial page)

You dont need to buy the red book for what you are doing. In reality you can teach yourself all you need to know by first getting some JOGL tutorial code and understanding it, then reading a few of the basic openGL tutorials on the web (there are loads out there - just do a google search).
 
Shame you have to do it with Java, I'd suggest OpenSG, its based on OpenGL but takes away all the pain of setting up a million parts of hte opengl state engine.
 
The only reason I said I would do it in Java is because I have the most experience in it and I have used VERY basic graphics command using Java2D, I just thought it would lend itself better than C, which is the only other language I have experience in, so if openGL works better in, or is more suited to C then i'm happy to use that.

It is straight C though not C++ right?

Thanks again!
 
Using openGL and java would be perfect for your project. You get the benefits of openGL + all the benefits of the standard java library, garbage collection etc etc.

Most people use openGL from C++, but thats only because its what they know, or because they need really extreme levels of performance.
p.s. Nasa worldwind is written in Java with JOGL!
 
Sorry for reviving a dead thread but i'm after some help cos i'm finding it hard to get jogl setup and working in Java using netbeans. I've looked in the user guide that was in the jogl zip file but I dont really understand all the pathnames etc you have to setup (using xp btw). Also I downloaded a couple of the sample programs from the NeHe site Lagz suggested but there's errors everywhere because it cant find the symbols/methods used, i'm guessing because it's not found the correct jogl library as stated by the import lines at the top of the file. Could anyone help explain how to setup the jogl library and what I need to include in the import command to get things started?

Thanks for any help.
 
You should have:

> Some .jar files (off the top of my head, I think they were called gluegen-rt.jar and jogl.jar)
> Some .dll files

You need to add the .jar files to your classpath (specify this to java and javac with -cp). Stick the .dll files in the same directory as the .jar files. Add this directory to your classpath as well. Then it should all work.

p.s: Eclipse is probably a lot easier to set this up in. I dont know how good netbeans is now, but it was pretty bad last time I looked!
 
Back
Top Bottom