Java 3D 骰子动画代码范例[2]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

diceFigure = new Figure("/res/dice.mbac");

 

六个不同动画可以全被合并到一个文件而不必使用六个不同的动画文件

action[0] = new ActionTable("/res/one.mtra");

action[1] = new ActionTable("/res/two.mtra");

action[2] = new ActionTable("/res/three.mtra");

action[3] = new ActionTable("/res/four.mtra");

action[4] = new ActionTable("/res/five.mtra");

action[5] = new ActionTable("/res/six.mtra");

      

在游戏循环中要保持动画帧的不断更新。

if(diceOneFrame < action[diceOneIndex].getNumFrames(0)){

diceOneFrame += action[diceOneIndex].getNumFrames(0)/frameLength[diceOneIndex];

}

diceFigure.setPosture(action[diceOneIndex], 0, diceOneFrame);

      

下载范例程序和源代码:

http://developer.sonyericsson.com/getDocument.do?docId=73634

 

原文地址:点击这里

本文关键:Java 3D 骰子动画代码范例
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top