Java and 3d.

Started by
12 comments, last by Starter 15 years, 9 months ago
So I was thinking of eventually making a java game. I was pretty set on 2d, then I got interested in making it 3d. I browsed the site and found out OpenGL was used in conjunction with java to make the 3d effects. Now I've never messed with OpenGL and was wondering if it was free to download and use? or if the article I read was outdated and something else is being used instead. I was also wondering if runescape is done in 3d? I'm pretty positive it is but I wanted to make a game (down the line) that looked as good as their HD trailer shows, or better (haha yeah right.) Thanks in Advance
Advertisement
Quote:
So I was thinking of eventually making a java game. I was pretty set on 2d, then I got interested in making it 3d. I browsed the site and found out OpenGL was used in conjunction with java to make the 3d effects. Now I've never messed with OpenGL and was wondering if it was free to download and use? or if the article I read was outdated and something else is being used instead.

OpenGL is freely available, you can find Java interfaces to it via a Google search for 'java opengl' and the like. It's pretty much the de-facto standard 3D API where Direct3D is not available (at which point you have a choice of which to use).


Quote:
I was also wondering if runescape is done in 3d?

Yes.
Awesome, Thank you.

I also stumbled across a bunch of great sites. For engines,tutorials, and the like. Thanks a bunch.
OpenGL with Java has been around for quite some time now. The two most widely used bindings are JOGL and LWJGL (first hit on Google). If you are looking into 3D graphics using Java, OpenGL is probably your best shot unless you are planning to write a software renderer which is not used widely in practice.

Just about everything related to OpenGL is free and open source. OpenGL is the graphics API of choice for games intended to be portable across different platforms. The official OpenGL website can provide you with more detailed information.

Runescape is done in 3D using Java. I think it was a software renderer until the new HD thing, but the Wikipedia article can verify this.
Try jME (http://www.jmonkeyengine.com/)

Quote:
jME (jMonkey Engine) is a high performance scene graph based graphics API. Much of the inspiration for jME comes from David Eberly's book 3D Game Engine Design.

jME was built to fulfill the lack of full featured graphics engines written in Java. Using a abstraction layer, it allows any rendering system to be plugged in. Currently, LWJGL is supported with plans for JOGL support in the near future.

jME is completely open source under the BSD license. You are free to use jME in anyway you see fit, hobby or commercial. All we ask is a little footnote (donations are nice too.)
Ok java is just driving me nuts lol. I can't find a coherent tutorial anywhere. I bought a few books. They all said to get general knowledge from another book or Sun's website before using their book. I go to Sun's website and just find tons of useless information and pics in their tutorials section.

C++ took me like 3 weeks to learn everything I needed for my intro classes in school. Then a few more months to learn what I needed for my advanced classes. It was all so easy to understand and consistent. Java feels so random and tutorials don't explain why I have to do certain things everytime.

Does anyone know a good place for me to start learning? I don't even want to make a game in Java anymore. I just wanna comprehend the language so I don't waste money when I start my Java classes in a few weeks (I cant learn computer related stuff from professors, I have to teach myself =( , It just goes in one ear and out the other) Any help is greatly appreciated. The tutorials I found on the website were no help either.
much of the basic syntax in c++ and java is identical. From a design and methodology standpoint they are very different, but it should really take you 5 minutes to start programming in java if you know any C++. you wont be an expert by any means, but most of the utility type stuff you can solve with a google search and the java style you can pick up as you go along.

is there anything specific about java thats confusing you?
much of my problems come from "Why?", I can write a program in java and have it work. Knowing what commands are supposed to be where. I just can't find a through explanation of why those commands do what they are intended to do. I just want to understand why its doing it, not just how to do it. That's whats coming up and causing problems for me.

A lot of what I've read says "You may not understand this code yet but it will be explained in later chapters" or "I will explain how this works later."

To which nosuch explanation comes about or they give me half an explanation
Did you go here: Java Tutorials

That's where I started out and it explains just about everything.
Yeah the java tutorials was weird to me. I started working back through it and hit this question.

class Bicycle {

int cadence = 0;
int speed = 0;
int gear = 1;

void changeCadence (int newValue) {
cadence = newValue;
}

void changeGear (int newGear) {
gear = newGear;
}

void speedUp (int increment) {
speed = speed + increment;
}

void applyBrakes (int decrement) {
speed = speed - decrement;
}

void printStates() {
System.out.println("Cadence:"+cadence+" Speed:"+speed+" Gear:"+gear);
}

}



Then the Bicycle Demo:

class BicycleDemo {
public static void main(String[] args) {

// Create two different Bicycle objects
Bicycle bike1 = new Bicycle();
Bicycle bike2 = new Bicycle();

// Invoke methods on those objects
bike1.changeCadence(50);
bike1.speedUp(10);
bike1.changeGear(2);
bike1.printStates();

bike2.changeCadence(50);
bike2.speedUp(10);
bike2.changeGear(2);
bike2.changeCadence(40);
bike2.speedUp(10);
bike2.changeGear(3);
bike2.printStates();
}
}


Now Neither application will run without the other. So I believe the Bicycle class is extended by the BicycleDemo class. But where am I calling it? I'm not extending the Bicycle app with the BicycleDemo class or I don't think so unless the Bicycle bike1 is calling it.

This topic is closed to new replies.

Advertisement