• Advertisement
Sign in to follow this  

Java and 3d.

This topic is 3506 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Awesome, Thank you.

I also stumbled across a bunch of great sites. For engines,tutorials, and the like. Thanks a bunch.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
It is just a simple test of object oriented concepts. Java compiles every class into its own .class file. So if any of your classes reference another than those classes need to be in the same directory or package or imported using the

import package_name_here;

The tutorial on packages will help you out.

The BicycleDemo class just refers to Bicycle and calls it methods.
If you know C++ than this shouldn't be an issue.

Share this post


Link to post
Share on other sites
Quote:
Original post by Xekyn
Now Neither application will run without the other.

You are confusing "class" with "application".

Quote:
Original post by Xekyn
So I believe the Bicycle class is extended by the BicycleDemo class.

You are confusing "client" with "heir". BicycleDemo is a client to Bicycle, because it has variables of type Bicycle.

Share this post


Link to post
Share on other sites
Thanks for pointing me back to sun's tutorials. I picked up a lot more info reading it the second time around.

Share this post


Link to post
Share on other sites
You're welcome. I wish you luck on your Java adventure. I made some cool things with Java and LWJGL so its definitely worth it. I made a simple FPS game and a applet software renderer and all sorts of other cool stuff. Probably update my website with them but I will have to see. Java is pretty cool, so again good luck.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement