void Start() { const float pointSize = 0.025f; var dt = new DtTrianglePlane(); fun.meshes.CreateTwoSidedTrianglePlane(dt).SetStandardShaderTransparentColor(0, 0, 1, 0.5); _mesh = dt.mesh; _b = fun.meshes.CreateSphere(new DtSphere { radius = pointSize, name = "Tri_ver_b" }).SetStandardShaderTransparentColor(0, 1, 0, 0.9).transform; _c = fun.meshes.CreateSphere(new DtSphere { radius = pointSize, name = "Tri_ver_c" }).SetStandardShaderTransparentColor(0, 1, 0, 0.9).transform; _b.position = Vector3.forward * 0.5f; _c.position = Vector3.right * 0.5f; _point = fun.meshes.CreateSphere(new DtSphere { radius = pointSize }) .SetStandardShaderTransparentColor(1, 1, 1, 0.9).transform; _projection = fun.meshes.CreateSphere(new DtSphere { radius = pointSize }) .SetStandardShaderTransparentColor(1, 0, 0, 0.9).transform; _point.position = new Vector3(0.5f, 0.5f, 0.5f); }
protected GameObject CreateTriangle(double pointSize, out Transform a, out Transform b, out Transform c, out Mesh mesh) { var dt = new DtTrianglePlane(); var tr = fun.meshes.CreateTwoSidedTrianglePlane(dt).SetStandardShaderTransparentColor(0, 0, 1, 0.5); a = fun.meshes.CreateSphere(new DtSphere { radius = pointSize, name = "Tri_ver_a" }).SetStandardShaderTransparentColor(0, 1, 0, 0.9).transform; b = fun.meshes.CreateSphere(new DtSphere { radius = pointSize, name = "Tri_ver_b" }).SetStandardShaderTransparentColor(0, 1, 0, 0.9).transform; c = fun.meshes.CreateSphere(new DtSphere { radius = pointSize, name = "Tri_ver_c" }).SetStandardShaderTransparentColor(0, 1, 0, 0.9).transform; mesh = dt.mesh; a.position = mesh.vertices[0]; b.position = mesh.vertices[1]; c.position = mesh.vertices[2]; return(tr); }