⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lineshape.java

📁 Java 多媒体技术(附源码) Java 3D API JavaSound API 各种格式的多媒体数据文件 JBuilder开发环境
💻 JAVA
字号:
package line3d;import javax.media.j3d.*;/** * <p>Title: 输出显示三维线</p> * <p>Description: 应用Java 3D API生成三维线</p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: 北京师范大学计算机系</p> * @author 王大伟 * @version 1.0 */public class lineShape extends Shape3D {    int StripCount[] = new int[3];    int[] index={ 0 , 1 , 3 , 2 , 3 , 5 , 4 , 6 , 7 , 8 , 6 } ;       int vertexCount = 11;    private float vert[] = {        -.3f , .8f , .0f, .3f , .8f , .0f, -.3f , .4f , .0f, .3f , .4f , .0f,        -.3f , .0f , .0f, .3f , .0f , .0f, -.3f , -.4f , .0f,         .3f , -.4f , .0f, -.3f , -.8f , .0f, .3f , -.8f , .0f, };     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, 0.0f, 0.5f, 1.0f,        0.5f, 0.0f, 1.0f, 0.0f, 0.8f, 2.0f, 1.0f, 0.0f, 0.3f      };     public lineShape() {              StripCount[0] = 4;              StripCount[1] = 3;              StripCount[2] = 4;        IndexedLineStripArray line = new IndexedLineStripArray(10 ,IndexedLineStripArray.COORDINATES|IndexedLineStripArray.COLOR_3, vertexCount , StripCount);          line.setCoordinates(0,vert);          line.setColors(0,color);                  line.setCoordinateIndices(0,index);                  line.setColorIndices(0,index);        LineAttributes la = new LineAttributes();          la.setLineWidth(10.0f);          la.setLineAntialiasingEnable(true);          la.setLinePattern(LineAttributes.PATTERN_DASH);        Appearance ap = new Appearance();         ap.setLineAttributes(la);        this.setGeometry(line);        this.setAppearance(ap);    }}//end of lineShape.java

⌨️ 快捷键说明

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