I want to do Java 3D Graphics without using external libraries to develop a game applet. Sorry I am not that experienced with Graphics and so I am not sure how hard it would be to do it by myself
The real answer to your question is that you're thinking about it a bit sideways: you shouldn't be using an applet (they're dead), and you shouldn't try to do it all by yourself without any libraries.
I'd personally recommend Processing for beginners or libGDX for more experienced users. They both allow you to do 3D, and they both allow you to deploy as JavaScript- which is better than applets.
If you really, really, really want to try to do this without any libraries, then you'll have to do all the 3D math and whatnot yourself, then do the drawing in Java2D. A very basic example of getting started is here, but like I said, you're on your own to do all the conversions from 3D world space to 2D drawing space.
Any sane person would use something like OpenGL instead, which you can find Java wrappers for- JOGL is a pretty basic wrapper (so if your goal is to get "close to the metal" then this might be your best bet), LWJGL provides a few extra features for game development, and the already-mentioned libGDX is built on top of LWJGL.
If you're afraid of using libraries because you think they're too complicated, let me tell you that doing 3D stuff without a library is even more complicated.
Related
I've noticed that using the Java libraries that are default built in, rendering the simplest graphics absolutely kills the FPS, and furthermore, looks ugly.
Now I was wondering if I could use JOGL or LWJGL libraries to use in my pre-existing program. (I'm making a game which renders cubes as planets, and you have to build planets.) Do I need to completely rewrite my code? Or can I just install these and render freely? And which one of the above is easier to understand, because I have limited knowledge in these libraries.
Btw, right now, I am using JFrames, does that need to go as well?
Also, what is OpenGL, is that good to use as well without rewriting code?
OpenGL is a standardized graphics interface for use between programs and your graphics card. A proprietary version of this by Microsoft is known as DirectX. LWJGL and JOGL are two different Java bindings to OpenGL libraries, both of which have native code they load in.
LWJGL is much more aimed towards gaming with OpenGL, where as JOGL is more worried about complete and perfect bindings to OpenGL/OpenCL. I would recommend LWJGL if you're just getting started.
You're going to have to rewrite your rendering code, yes. But assuming you designed your project well, you shouldn't need to rewrite the game logic. JFrames will probably also have to go, but I'm not completely sure about that.
Please don't turn this question into another "JOGL vs LWJGL" thread. Moreover, JOGL is used in several games including Poxnora and Salem (MMO). You'll have to learn OpenGL if you want to use any Java binding of this API anyway.
Finally, you can use GLG2D in order to get a better hardware acceleration with plain Swing, it would allow you to benefit of better performance only with a very few changes in your program. GLG2D relies on JOGL 2, you can find more information about it here: http://brandonborkholder.github.io/glg2d/
I'm trying to design a side scroller for android and a level editor for windows. A lot of the code between the two programs will be the same. The bit I'm currently working on is drawing textures.
What I currently have is a library that includes code related to loading and drawing the texture information. The bit that I'm stuck on is how would I incorporate OpenGL (for windows) and OpenGL ES (for android) into the library?
I thought about having an interface that includes all the drawing functions and then implementing that interface separately within each program (since one will use OpenGL and one OpenGL ES) but that still produces a lot of duplicated code (and kinda defeats the purpose of trying to create this shared library).
Is there a better way to approach this problem? Am I just over complicating this by trying to make it too flexible? I have been thinking about this for a few sdays now, so any input would be greatly appreciated!
Please ask if anything doesn't make sense!
OpenGL and OpenGL-ES are similar enough, that you can share large amounts of the codebase. Since you're probably going to target OpenGL-ES-2, you will then probably use OpenGL-3 on the desktop. OpenGL-3 has a lot of what OpenGL-ES-2 has. So I suggest you develop your code primarily for OpenGL-ES-2 and then only for the small differences toward OpenGL-3 you add alternative codepaths.
I'm writing an online multiplayer game, and I'm thinking about implementing the network code in Java, using JBoss Netty. But I'm considering C++ for the 3D rendering (they're simple graphics, nothing extensive). Would it be worth implementing such behavior in C++?
Would it be worth implementing such behavior in C++?
No, I would recommend doing everything in java or in c++. That way you won't have any problems with c++ to java interoperability. In case you already have the network code in java I would go for that.
If you choose java you can use a 3D rendering library like for example jogl or lwjgl. These libraries are really light weight and you will probably not have any problems with the actual rendering performance since it is done by the graphics chip.
I've made my share of 2D games on various platforms but I have never developed a 3D game.
I want to make a small "mmorpg". I already made my server in python and it works just fine with my flash 2D game but I decided I want to step it up and try out 3D. I want to make a 3D game for the web browser and I think Java might be a good choice for this.
So basically I'm just looking for a straight forward and well documents 'framework' to make LOW-END 3D games. Keep in mind that I will be targeting peoples with very low-end PC's (plus my 3d modeling skills aren't great so I wouldn't mind hiding it somewhat, haha)
If you care to develop your own software 3D engine, which is pretty cool, Developing Games in Java is a complete walkthrough, step-by-step, of developing a 3D engine in pure Java, capable of rendering textured and lit polygons. You learn a lot about the math involved and you realize that it's really not a terribly hard thing to do; in addition, the engine is all yours, so you know it inside and out and you don't have to learn an API. On the flipside, it might be outdated. It's been sitting on my shelf for a number of years now, but it is made with Java 1.4 so it's not all too old.
Otherwise, I would definitely recommend JOGL or its competitor LWJGL; however, both require OpenGL knowledge, so if you want to just deal with loading 3D models and moving them around, jMonkeyEngine could be a better option for you. There is also the lesser-known Xith3D engine, somewhat a competitor to jME, though it hasn't been updated in over a year.
P.S. Ever seen RuneScape? It used JOGL, though now I think they switched to their own port of only the OpenGL functions that their code uses, kind of like a stripped-down version of JOGL.
JOGL would be a good possibility. You could look at the older "Java3D" framework as well.
You might want to check out the jMonkeyEngine.
I would advise against Java3D. We're using it for a project and frequently run into gotchas. If we had the resources, I'd migrate to something else in a second.
Recently I've been craving some game programming. I primarily use Linux, and was wondering if there are any good graphics libraries for Java development on Linux? Google didn't turn up very much useful information on the subject.
Also, would another language be better? I would like to avoid using python -- Ruby and Java are my two favorite languages. There doesn't seem to be much talk about game programming on Linux in general, unfortunately.
Any suggestions/resources? Easy portability or cross-platform functionality would be awesome too.
Oh, and I prefer 2D graphics.
What about the APIs mentioned in Pro Java 6 3D Game Development: Java3D, JOGL, JInput and JOAL APIs.
Topics are split into three sections: Java 3D API, non-standard input devices for game playing, and JOGL. Java 3D is a high-level 3D graphics API, and JOGL is a lower-level Java wrapper around the popular OpenGL graphics API.
You'll look at three non-standard input devices: the webcam, the game pad, and the P5 data glove.
Along the way, you'll utilize several other games-related libraries including: JInput, JOAL, JMF, and Odejava.
Learn all the latest Java SE 6 features relevant to gaming, including: splash screens, JavaScript scripting as well as the desktop and system tray interfaces.
Or have a look at Java 2D Game Frameworks here on SO.
For game programming there's a nice little framework available, jMonkeyEngine, it support both LWJGL and JOGL.
JOGL is supposed to be cross-platform. There's a wrapper which includes additional functionality called Lightweight Java Game Library.
How about Flash? The PushButton Engine looks fun.
Golden T Game Engine
I think the Golden T Game Engine is the sort of thing that you are looking for. It makes it very easy to get into actually making a game without having to worry about a lot of boilerplate code.
Golden T Game Engine (GTGE) is an advanced cross-platform game programming library written in Java language.
GTGE library provides a complete routines for making 2D game from low level routines such as hardware accelerated 2D graphics, mouse and keyboard input, audio support, game timing, to game specific routines such as sprite, background, collision detection.
...
GTGE is a high level interface library, it means programmer never has to worry about any low level commands anymore. The only thing left for the programmer is use their imagination and start programming their game.
You don't have to know anything about managing graphics, input, and other low level stuff in Java. Instead you can start immediately develop your own game using the latest Java technology, such as bufferstrategy, volatile image, and even OpenGL easily. You can check out GTGE design standard simplicity, generic, and replacable.