Jump to content
  • Advertisement
Sign in to follow this  
KieranWood

[Java] Anyone know where to find resources for Java3D applet programming?

This topic is 2381 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

Hey there, thanks for taking the time to view this thread.

I've been learning Java, it's quite similar to C++ so I'm not having any problems so far, but I'm interested in programming applets using the Java3D API.
I understand that there is google, but I have been searching for quite a while now and can't seem to find any books or tutorials that teach Java3D specifically with applets.
I tried using the same code from some Java3D examples with an applet class, but the applet opens a separate window.

Here's an example of what I tried:

import java.applet.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;

public class Hello3D extends Applet
{
public void init()
{
SimpleUniverse universe = new SimpleUniverse();
BranchGroup group = new BranchGroup();

group.addChild(new ColorCube(0.3f));

universe.getViewingPlatform().setNominalViewingTransform();
universe.addBranchGraph(group);
}
}



If you know of any resources, such as books or tutorials that you could recommend for this type of development, please let me know. It will be greatly appreciated.

Thank you for your time.

Kieran

Share this post


Link to post
Share on other sites
Advertisement

Hey there, thanks for taking the time to view this thread.

I've been learning Java, it's quite similar to C++ so I'm not having any problems so far, but I'm interested in programming applets using the Java3D API.
I understand that there is google, but I have been searching for quite a while now and can't seem to find any books or tutorials that teach Java3D specifically with applets.
I tried using the same code from some Java3D examples with an applet class, but the applet opens a separate window.

Here's an example of what I tried:

import java.applet.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;

public class Hello3D extends Applet
{
public void init()
{
SimpleUniverse universe = new SimpleUniverse();
BranchGroup group = new BranchGroup();

group.addChild(new ColorCube(0.3f));

universe.getViewingPlatform().setNominalViewingTransform();
universe.addBranchGraph(group);
}
}



If you know of any resources, such as books or tutorials that you could recommend for this type of development, please let me know. It will be greatly appreciated.

Thank you for your time.

Kieran


I thought J3D was abandoned? Anyways, you should look into LWJGL, Light Weight Java Game Library. The best and fastest way to describe it is, go check out minecraft. It is made with LWJGL. You can also play minecraft online @ www.minecraft.net right in your browser.

Share this post


Link to post
Share on other sites
Have a look here:

- Java 3D applet samples AppletObjLoader and AppletVrmlLoader : http://www.interacti...de/applets.html

- Java 3D applet sample PropellerUniverse : http://www.interacti...tml#heavyweight

- Java 3D book Andrew Davison, Killer Game Programming : http://fivedots.coe.psu.ac.th/~ad/jg/

- Java 3D book Daniel Selman, Java 3D Programming : http://www.manning.com/selman/

August

Share this post


Link to post
Share on other sites

I thought J3D was abandoned? Anyways, you should look into LWJGL, Light Weight Java Game Library. The best and fastest way to describe it is, go check out minecraft. It is made with LWJGL. You can also play minecraft online @ www.minecraft.net right in your browser.


Oh? I wasn't aware. Why was it abandoned? And is it still any good to use?

I have seen minecraft, I don't care much for the graphics. Is LWJGL capable of better graphics than that? I'm not asking for anything amazing though.


In the mean time I will look into it. Thank you for the reply :)




Have a look here:
- Java 3D applet samples AppletObjLoader and AppletVrmlLoader : http://www.interacti...de/applets.html
- Java 3D applet sample PropellerUniverse : http://www.interacti...tml#heavyweight
- Java 3D book Andrew Davison, Killer Game Programming : http://fivedots.coe.psu.ac.th/~ad/jg/
- Java 3D book Daniel Selman, Java 3D Programming : http://www.manning.com/selman/

August


Thank you for the reply :) I will have a look at those when I get a chance.

Share this post


Link to post
Share on other sites

Oh? I wasn't aware. Why was it abandoned? And is it still any good to use?

For lots of reasons it wasn't very popular. Sun (Yes, it really was that long ago!) put it on hold while developing the JavaFX technology.
Yes you could still use it, but nowadays it's maintained as an open source project. So don't expect any offical updates from Oracle.



I have seen minecraft, I don't care much for the graphics. Is LWJGL capable of better graphics than that? I'm not asking for anything amazing though.

Yes, LWJGL can produce very good graphics. It's just a java API wrapper for OpenGL.
Minecraft is "blocky" by design :)

Share this post


Link to post
Share on other sites
Java3D was abandoned in 2004.

Oracle and the powers that steer the development of Java hate multimedia with passion since it has no use in corporate environments.


There are various OGL bindings, but they tend to be quite quirky with many chipsets. They are just direct binding for OGL API, so documentation can be a bit lacking since it relies on understanding the OGL pipeline and being able to read the original C API documentation or understand how it maps to Java.

Thank you for the reply :) I will have a look at those when I get a chance.[/quote]Don't bother, it's been dead for 7 years and it's just another example of what happens when APIs are designed by architecture astronauts who never actually solve problems like that in practice. Like most of Java libraries.

Share this post


Link to post
Share on other sites
The latest Java 3D release 1.5.2 was published in June 2008.

This Java 3D forum thread might be worth reading 'Java3D viability questions... ' http://forums.oracle...150209&tstart=0

The new Java 3D home is http://java.net/projects/java3d and it is still under construction.

You have to decide if a low level OpenGL binding API like JOGL and LWJGL or a high level API like Ardor3D, Aviatrix3D, Java 3D, jMonkeyEngine, and Xith3D meets your application's 3D requirements.

August

Share this post


Link to post
Share on other sites
I know this topic is old now, but this is just for reference of anyone else who is interested.

Java3d by default will not work in a regular applet without being installed on the client computer. There is the option of using java web start with JNLP or using the AppletJNLPLauncher however webstart does not enable webpage embedding and the applet jnlp launcher unfortunately seems to have some issues (I personally am unable to get it to work on my computer). This is why for my own work with Java3d I developed a jar that can be included in your applet archive path and launched in your program to add Java3d support. it can be found here: http://people.bu.edu/rrusso1/java3d.html.

To use it simply call 'new Java3dLinker()' as the first line of your program and it will determine the OS you are running on and put the necessary native library files in your temp path directory and add the temp directory to your java path. Currently supported is Mac OS X, Windows, and Linux in both 32 or 64 bit for each. And to use this your jar files for the applet must be signed otherwise you cannot get the necessary permissions to modify the contents of the temp path. Let me know if this works for everyone or if you have any problems.

Share this post


Link to post
Share on other sites

Thank you all for the help, I really appreciate it.

Do any of you know if there are any good tutorials for LWJGL?


While LWJGL is a bit different than OpenGL, at its core, it is still a wrapper around OpenGL. Unless your project absolutely must be written in Java, I would recommend first learning OpenGL in either C or C++. If you want to find tutorials for LWJGL, you can find it at their home site @ http://lwjgl.org/

If you do not like C/C++, you should learn Python and using these libraries to help you get started:

PyOpenGL - OpenGL Wrapper for Python
PyQt - Qt Wrapper for Python
numPy - used for optimized number calculations. Useful when dealing with array of numbers and allocating them in a block of memory that's usable by OpenGL

The reason is that with PyQt, it is extremely easy to deploy things with GUI. Most importantly, you can quickly dive right into the OpenGL side without worrying about pointers, WIN API stuff. Aside from those, Python is also cross platform. While C++ does support X platforms, it would need macros to differentiate between them. I argue that using PyQt + PyOpenGL, you avoid dealing with those till you have to.

Having said that, you may also use Qt with C++ which is what Qt originally made for. This chose would also allow you to avoid making WIN API calls.


Before you go right in, you should be aware that OpenGL is under going massive changes. Be very careful about what you are trying to achieve and with which version of OpenGL. Specifically, if you are using GLSL, the programmable graphics pipeline, then you should choose version 2.x or above. While the higher version (probably 3.0 and above) isn't wide spread yet, you should not learn the "old" ways of doing things (glBegin, glEnd, glVertex, glNormal...etc). Keep in mind that even GLSL is undergoing many changes. Starting from version 110 all the way to 420, there are a lot of changes. It seems that the most wide spread version are 2.1 with GLSL version 120. I might be wrong on this, but that's what I heard.

Anyways, hope that helps.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!