draw3d_stripline.java

来自「一个java3D的动画程序」· Java 代码 · 共 56 行

JAVA
56
字号
/*
 * Created on 2005-7-17
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package AixsSet;

/*
 * Created on 2005-7-17
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author carso
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
import javax.media.j3d.*;


public class Draw3D_Stripline extends Shape3D { 
  

   private float color[] = { 
       0.0f,0.5f,1.0f, 
       0.5f,0.0f,1.0f, 
       0.0f,0.8f,2.0f, 
       1.0f,0.0f,0.3f, 
       0.0f,1.0f,0.3f, 
       0.3f,0.8f,0.0f, 
     }; 
 
   
   public Draw3D_Stripline(float[] vert,int[] StripCount) { 

       	LineStripArray line = new LineStripArray(6,  
       	LineStripArray.COORDINATES| 
		LineStripArray.COLOR_3,StripCount); 
         line.setCoordinates(0,vert); 
         line.setColors(0,color); 
         LineAttributes la = new LineAttributes(); 
         la.setLineWidth(50.0f); 
         la.setLineAntialiasingEnable(true); 
         la.setLinePattern(LineAttributes.PATTERN_DASH); 
         Appearance ap = new Appearance(); 
         ap.setLineAttributes(la); 
         this.setGeometry(line); 
         this.setAppearance(ap);  

   } 
} 

⌨️ 快捷键说明

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