ellipticlimb.java

来自「java3D game engine design of the source 」· Java 代码 · 共 40 行

JAVA
40
字号

// EllipticLimb.java
// Thana Konglikhit, October 2003, s4310170@maliwan.psu.ac.th
// Andrew Davison, dandrew@ratree.psu.ac.th

/* An unmoveable Limb object but using an elliptical lathe shape
   rather than a circular one.
*/

import javax.media.j3d.*;
import com.sun.j3d.utils.image.*;


public class EllipticLimb extends Limb
{
  public EllipticLimb(int lNo, String jn0, String jn1, 
                      int axis, double angle, 
                      double[] xs, double[] ys, String tex)
  {  super(lNo, jn0, jn1, axis, angle, xs, ys, tex);  }


  protected void makeShape()
  // overridden to make a EllipseShape3D instead of LatheShape3D
  {
    EllipseShape3D es;
    if (texPath != null) {
      // System.out.println("Loading textures/" + texPath);
      TextureLoader texLd = new TextureLoader("textures/"+texPath, null);
      Texture tex = texLd.getTexture();      
      es = new EllipseShape3D(xsIn, ysIn, tex);
    }
    else  
      es = new EllipseShape3D(xsIn, ysIn, null);
    
    zAxisTG.addChild(es);  // add the shape to the limb's graph
  }  // end of makeShape()


}  // end of EllipticLimb class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?