Java 3D

i spent 3 hours working on the sample Java3D application yesterday afternoon. But ended up in vain.
I can get the app that i've written for my college paper work.
I've downloaded the Java3D 1.3 API and did the following steps:
1. Unzip the package
2. Put the 3 dlls into the /JAVA-HOME/bin folder
3. Put the 2 jars into the /JAVA-HOME/jre/lib folder

By doing so, we can have the sample from PSU.th working. B/C the sample only use the Java3Dtimer which is implemented in the jar file.
However, we still can't run the app that i've made.

Today i've downloaded the runtime for JRE: java3d-1_3_1-windows-i586-opengl-rt.exe file from sun.com. The problem is solved. I can see the nice little cube rotating in my app.

This morning i was setting up the tomcat on my laptop.
Tomcat 5.0 needs J2SE 5.0 support
Tomcat 4.0 can work under J2SE 1.4 the welcome page is located on http://127.0.0.1:8080. Don't Forget the "http://"

I fixed the eclipse compiling problem by importing a jar file: /Java-Home/jre/lib/ext/vecmath.jar

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
JAVA 3D开发工具包(3个版本),java3d-1_3、java3d-1_4、java3d-1_5,加一个例子。例子代码如下: import java.awt.GraphicsConfiguration; import javax.media.j3d.Alpha; import javax.media.j3d.BoundingSphere; import javax.media.j3d.BranchGroup; import javax.media.j3d.Canvas3D; import javax.media.j3d.RotationInterpolator; import javax.media.j3d.Transform3D; import javax.media.j3d.TransformGroup; import javax.swing.JApplet; import javax.vecmath.Point3d; import com.sun.j3d.utils.geometry.ColorCube; import com.sun.j3d.utils.universe.SimpleUniverse; import com.sun.j3d.utils.universe.ViewingPlatform; public class HelloUniverse extends JApplet { public BranchGroup createSceneGraph() { BranchGroup objRoot = new BranchGroup(); //新建一个变形组结点,初始化它 //变形组结点指定一个单一的空间变形,通过一个Transform3D对象, //能对它的子结点定位,定向,定尺寸 TransformGroup objTrans = new TransformGroup(); //指定结点可以写入它的对象的变形信息。这样我们的行为代码就能在运行进修改它。 objTrans.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE); //根节结中加入这个变形组结点 objRoot.addChild(objTrans); //新建一个例子Shape3D结点,并把它加入到场景图表中 objTrans.addChild(new ColorCube(0.4)); Transform3D yAxis = new Transform3D(); /* * 提供转换一个时间值到一个0到1之间的alpha值的方法 * 第一个参数loopCount:运行循环次数,-1表示无限循环 * 第二个参数increasingAlphaDuration:alpha值从0到1的时间周期 */ Alpha rotationAlpha = new Alpha(-1, 4000); //新建旋转者,它将执行变形操作 RotationInterpolator rotator = new RotationInterpolator( rotationAlpha, objTrans, yAxis, 0.0f, (float) Math.PI*2.0f); //用一个中心点和半径定义一个球状范围区域。 BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); //设置旋转者的运行范围 rotator.setSchedulingBounds(bounds); //加它到根结点 objRoot.addChild(rotator); //执行优化 objRoot.compile(); return objRoot;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值