Results 1 to 1 of 1
- 06-10-2010, 04:29 PM #1
Java3D run application without plugin
I have create a simple java 3d application.
test2.java
But I need the java3D plugin for run it.Java Code:import javax.media.j3d.AmbientLight; import javax.media.j3d.Appearance; import javax.media.j3d.BoundingSphere; import javax.media.j3d.BranchGroup; import javax.media.j3d.DirectionalLight; import javax.media.j3d.Material; import javax.media.j3d.Transform3D; import javax.media.j3d.TransformGroup; import javax.vecmath.Color3f; import javax.vecmath.Point3d; import javax.vecmath.Vector3f; import com.sun.j3d.utils.geometry.Sphere; import com.sun.j3d.utils.universe.SimpleUniverse; public class test2 { private static final long serialVersionUID = 1L; Color3f red = new Color3f(1.0f, 0.0f, 0.0f); Color3f black = new Color3f(0.0f, 0.0f, 0.0f); Color3f white = new Color3f(1.0f, 1.0f, 1.0f); public static void main(String[] args) { new test2(); } public test2() { SimpleUniverse universe = new SimpleUniverse(); BranchGroup objRoot = createGroup(); Transform3D transform = new Transform3D(); Vector3f vector = new Vector3f(0.0f, 0.0f, -1.0f); transform.setTranslation(vector); TransformGroup transformGroup = new TransformGroup(transform); objRoot.addChild(transformGroup); Appearance appearance = new Appearance(); appearance.setMaterial(new Material(black, red, white, red, 64)); transformGroup.addChild(new Sphere(0.3f, appearance)); universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(objRoot); } public BranchGroup createGroup() { BranchGroup objRoot = new BranchGroup(); BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); Color3f light1Color = new Color3f(1.0f, 1.0f, 1.0f); Vector3f light1Direction = new Vector3f(-5.0f, -8.0f, -12.0f); DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction); light1.setInfluencingBounds(bounds); objRoot.addChild(light1); Color3f ambient1Color = new Color3f(0.1f, 0.1f, 0.1f); AmbientLight ambient1LightNode = new AmbientLight(ambient1Color); ambient1LightNode.setInfluencingBounds(bounds); objRoot.addChild(ambient1LightNode); return objRoot; } }
(plugin: http://download.java.net/media/java3...ndows-i586.exe)
But before I had the java 3d plugin I could run all 3d aplications of this page:
https://j3d-webstart.dev.java.net/test/
I know it's possible, but I don't know how.
Does someone know it?
Thanks,
Dennis
Similar Threads
-
java3d installation help
By diggitydoggz in forum New To JavaReplies: 4Last Post: 11-02-2009, 10:56 AM -
Java3D
By dawiz001 in forum New To JavaReplies: 1Last Post: 03-08-2009, 02:56 AM -
Someone else in Java3D... ?
By QuickMick in forum IntroductionsReplies: 0Last Post: 02-18-2009, 11:47 AM -
Java3D
By gowry in forum Advanced JavaReplies: 0Last Post: 04-21-2008, 08:07 AM -
AnyEdit Plugin For Eclipse Plugin
By JavaForums in forum EclipseReplies: 0Last Post: 05-18-2007, 12:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks