public TriangleMesh(Vector3 p0, Vector3 p1, Vector3 p2, Material mat) { this.p0 = p0; this.p1 = p1; this.p2 = p2; this.material = mat; this.norm = Vector3.Cross(p2 - p0, p1 - p0); this.norm.Normalize(); }
public CheckerPlain(Vector3 p, Vector3 norm, Material mat, Material mat2) { norm.Normalize(); this.pos = p; this.norm = norm; this.material = mat; this.material2 = mat2; v1 = new Vector3(norm.Z, 0, -norm.X); v2 = new Vector3(0, norm.Z, -norm.Y); v1.Normalize(); v2.Normalize(); }
public void InitializeMaterials() { // マテリアルを作成 material1 = new Material( new Vector3(0.05f, 0.01f, 0.01f), new Vector3(0.05f, 0.01f, 0.01f), new Vector3(0, 0, 0), 32.0f ); material2 = new Material( new Vector3(0.01f, 0.01f, 0.05f), new Vector3(0.01f, 0.01f, 0.05f), new Vector3(0, 0, 0), 32.0f ); material3 = new Material( new Vector3(0.05f, 0.05f, 0.05f), new Vector3(0.05f, 0.05f, 0.05f), new Vector3(0, 0, 0), 32.0f ); material4 = new Material( new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0, 0, 0), 32.0f ); material5 = new Material( new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0, 0, 0), 32.0f, 0.9f, 0.0f, 0.1f ); material6 = new Material( new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0, 0, 0), 32.0f, 0.0f, 0.9f, 0.1f ); material7 = new Material( new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0.01f, 0.05f, 0.01f), new Vector3(0, 0, 0), 32.0f, 1, 0, 0 ); }
public Sphere(double rad, Vector3 pos, Material mat) { r = rad; center = pos; material = mat; }