tutorials

i really want to learn java3di tried to learn from the tutorials in www.j3d.org and the tutorials that came with the java3d apiand i understood nothing from themso somone can plz give me a site with a good tutorials?
[251 byte] By [Dnw] at [2007-9-26 2:36:33]
# 1

I have been getting into J3D recently as well, and I have yet to find a site with any great tutorials. Here are some links you may find useful, I got some info out of them.

http://java.sun.com/products/java-media/3D/collateral/class_notes/java3d.htm

http://www.java3d.org/tutorial/

besJ at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 2
Do you have any experience with 3D graphics ?If no, then i would recommend to also read a general book on 3D graphics also to get used to the terminology and concepts. Also try http://www.j3d.org
pszawlow at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 3
i have no experience in 3d graphics what's sense graph is it the universe and branchgroup?
Dnw at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 4
i meant scenegraph
Dnw at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 5

It would be a good idea to familiarize yourself witht he basics of 3d graphics, especially concepts like lighting, texturing, and rendering.

A scene graph is like a directory tree for your scene. It stores information about how all the objects (such as shapes, lights, etc) are related to eah other, defining a hierarchical grouping of objects. The "virtual" universe is the thing which contains everything else, including the scene graph. Branchgroups contain shapes and transforms, and the group itself is added to the scenegraph, which in turn is added to the universe.

besJ at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 6

what's the difference between simpleuniverse and virtualuniverse?

and what's with this code i can't see my sphere?

import com.sun.j3d.utils.geometry.*;

import com.sun.j3d.utils.universe.*;

import javax.media.j3d.*;

import javax.vecmath.*;

public class Main

{

public Main()

{

SimpleUniverse su=new SimpleUniverse();

BranchGroup bg=new BranchGroup();

Sphere sp=new Sphere(0.5f);

bg.addChild(sp);

su.getViewingPlatform().setNominalViewingTransform();

su.addBranchGraph(bg);

}

public static void main(String[] args)

{

Main m=new Main();

}

}

Dnw at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 7

Sorry, the virtual universe is just a term for the universe itself. A SimpleUniverse is a convenience class that makes setting up a basic 3d scene easier. To do this manually takes around 5 steps, but the simple universe does at least 3 of these automatically.

I am not sure what is wrong with your code. First, you should have a Canvas3D object which the universe can draw itself in. You may also need to create a frame to display the canvas itself in. Here is some sample code i got from a tutorial that oulines the basics:

import com.sun.j3d.utils.universe.*;

import com.sun.j3d.utils.geometry.*;

import javax.media.j3d.*;

import javax.vecmath.*;

import java.awt.*;

public static void main( String[] args ) {

Frame frame = new Frame( );

frame.setSize( 640, 480 );

frame.setLayout( new BorderLayout( ) );

Canvas3D canvas = new Canvas3D( null );

frame.add( "Center", canvas );

SimpleUniverse univ = new SimpleUniverse( canvas );

univ.getViewingPlatform( ).setNominalViewingTransform( );

BranchGroup scene = createSceneGraph( );

scene.compile( );

univ.addBranchGraph( scene );

frame.show( );

}

public BranchGroup createSceneGraph( )

{

BranchGroup branch = new BranchGroup( );

ColorCube demo = new ColorCube( 0.4 );

trans.addChild( demo );

}

Try something like this and see if it works.

besJ at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 8
Oh, and in the createSceneGraph() method you will need the linereturn branch;at the end.
besJ at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 9
but simpleuniverse create a black window what's virtualuniverse do?
Dnw at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...
# 10

I am not quite certain what you mean. To the best of my knowledge, "virtual universe" is simply a term used to describe a universe in general. Like I said before, a simple universe is merely a convenience class - that is, a special type of "virtual universe" that makes setting up a 3d scene much simpler.

besJ at 2007-6-29 10:04:30 > top of Java-index,Security,Cryptography...