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

📄 ceiling.java

📁 一个java 3D程序的源代码
💻 JAVA
字号:
public class ceiling extends solidObject{

	public vector start;
	public vector iDirection, jDirection, kDirection;
	public vector[] specularCentre;

	public ceiling(double x, double y, double z){
		start = new vector(x,y,z);
		iDirection = new vector(1,0,0);
		jDirection = new vector(0,1,0);
		kDirection = new vector(0,0,1);

		this.start = start;
		makeBoundary();
		super.visible = super.testVisibility();
		super.tempCentre = new vector(0,0,0);
		super.findCentre();
		makePolygons();
	}

	public void makeBoundary(){
		boundary = new polygon3D[6];
		vector[] a = new vector[]{put(70.2, 0, -0.2),  put(70.2, 0, 70), put(-0.2, 0, 70), put(-0.2, 0, -0.2)};
		boundary[0] = new polygon3D(a, null, null, null, null);
		vector[] b = new vector[]{put(70.2, 0, -0.2),  put(70.2, 0, 70), put(-0.2, 0, 70), put(-0.2, 0, -0.2)};
		boundary[1] = new polygon3D(b, null, null, null, null);
		vector[] c = new vector[]{put(70.2, 0, -0.2),  put(70.2, 0, 70), put(-0.2, 0, 70), put(-0.2, 0, -0.2)};
		boundary[2] = new polygon3D(c, null, null, null, null);
		vector[] d = new vector[]{put(70.2, 0, -0.2),  put(70.2, 0, 70), put(-0.2, 0, 70), put(-0.2, 0, -0.2)};
		boundary[3] = new polygon3D(d, null, null, null, null);
		vector[] e = new vector[]{put(70.2, 0, -0.2),  put(70.2, 0, 70), put(-0.2, 0, 70), put(-0.2, 0, -0.2)};
		boundary[4] = new polygon3D(e, null, null, null, null);
		vector[] f = new vector[]{put(70.2, 0, -0.2),  put(70.2, 0, 70), put(-0.2, 0, 70), put(-0.2, 0, -0.2)};
		boundary[5] = new polygon3D(f, null, null, null, null);

	}

	public void makePolygons(){
		polygons = new polygon3D[1];
		vector[] t;

		LightSource.s1.set(10,10,10);

		t = new vector[]{put(70, 0, 0), put(70, 0, 70), put(0, 0, 70), put(0, 0, 0)};
		polygons[0] = new polygon3D(t, t[0],  t[1], t[3], gallery.textures[4]);
		polygons[0].scaleX = 5;
		polygons[0].scaleY = 5;

		LightSource.s1.set(-10,10,-10);
	}

	public vector put(double i, double j, double k){
		vector temp = new vector(0,0,0);
		temp.set(start);
		temp.add(iDirection, i);
		temp.add(jDirection, j);
		temp.add(kDirection, k);
		return temp;
	}

}

⌨️ 快捷键说明

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