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

📄 lineshape3.java

📁 关于java3D学习的示例程序
💻 JAVA
字号:
import javax.media.j3d.*;
public class lineShape3 extends Shape3D{
	int[] index={1,0,0,3,2,4};
	int iCount=6;
	int vCount=5;
	private float vert[]={.5f,0.5f,0.0f,-0.5f,0.5f,0.0f,
	                      0.3f,0.0f,0.0f,-0.3f,0.0f,0.0f,-0.5f,-0.5f,0.0f,};
	private float color[]={0.0f,0.5f,1.0f,0.0f,0.5f,1.0f,
	                      0.0f,0.8f,2.0f,1.0f,0.0f,0.3f,0.0f,1.0f,0.3f,};
	public lineShape3(){
		IndexedLineArray line=new IndexedLineArray(vCount,IndexedLineArray.COORDINATES|IndexedLineArray.COLOR_3,iCount);
		line.setCoordinates(0,vert);
		line.setColors(0,color);
		line.setCoordinateIndices(0,index);
		line.setColorIndices(0,index);
		LineAttributes linea=new LineAttributes();
		linea.setLineWidth(5.0f);
		linea.setLineAntialiasingEnable(true);
		linea.setLinePattern(LineAttributes.PATTERN_DASH_DOT);
		Appearance app=new Appearance();
		app.setLineAttributes(linea);
		this.setGeometry(line);
		this.setAppearance(app);
	}
}

⌨️ 快捷键说明

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