Monday, December 22, 2008

3D Game Programming in Java using the jMonkeyEngine #1

I am going to start a tutorial to create a 3D game using jMonkeyEngine (JME), FengGUI,  JME Physics, JMF and Blender using eclipse.

If you wonder how Java can be used for game programming, see my prior post.

I am not an expert at all of these areas so I will be able to share with you any issues that I run across as I am using them.

I am assuming that you are familiar with Java and eclipse. I am also assuming you are using an XP or Window's Vista system. I am using eclipse version 3.4.0 and Java 1.5. If you haven't installed them yet, you can see my first post.

The first thing we need to do is to install some of these technologies.

Download and Install Blender:
http://www.blender.org/download/get-blender/
select the Windows 32 bit Blender 2.48a Installer
Install that onto your windows system. To use Blender, you also have to have python installed.
http://www.python.org/download/
I downloaded Python 2.6.1 Windows installer.
Install Python first, and then install Blender.

In eclipse you should create a project and in that project, create a directory call lib.

You will also need the lightweight java game library and you can download that here:
http://lwjgl.org/download.php
Download the latest version which is LWJGL 2.0.1
Unzip the zip folder you downloaded and locate the jar directory. Place all those jar files in your lib folder of your project and set your build path to point to them. If you don't know how to set your build path, you can visit one of my prior posts.

You will also need to download jogl.
You can download jogl at this website: https://jogl.dev.java.net/#NIGHTLY
You should download jogl-1.1.2-pre-20080523-windows-i586.zip. If you download the amd64 by accident and try to run your jogl programs, you will receive an error if you are using a 32bit system.

To set up jogl you should create a folder in your lib directory called resources. Locate the lib folder in the jogl you just downloaded. You need to unzip it first. Copy the jogl.jar and gluegen-rt.jar in your lib folder and copy the dll files in your resources folder. You need to set your build path to the jogl jar files. You also need to set the Native Libraries to the dll files. To do this you should press the right mouse button on your project and select properties. Select the Java Build Path and select the libraries tab. Under the libraries tab, select Native Library Location. You should select edit and select external folder. Locate the resource directory you put the dll files in and press okay. The path should say: ProjectName/lib/resources.

In my next post I will show you how to install
jMonkeyEngine (JME), FengGUI, and JME Physics

Go To #2

2 comments:

Anonymous January 3, 2009 at 2:04 PM  

what is fengui and how is it related to this?

Greg January 3, 2009 at 9:37 PM  

FENGUI is a graphical user interface based on OpenGL. Therefore, it is a good tool to create menus and HUDs for JME. I am going to show you how you can use it within your game. You can see the JME website for more information.