public static RandomTriangleScene CreateRandomTriangles(int triangleCount) { RandomTriangleScene scene = new RandomTriangleScene(); scene.vertexCount = 3 * triangleCount; scene.colors = new Vector4[scene.vertexCount]; scene.vertices = new Vector3[scene.vertexCount]; for (int i = 0; i < scene.vertexCount; i++) { scene.colors[i] = new Vector4(GetRandom0to1(), GetRandom0to1(), GetRandom0to1(), 0.5f); scene.vertices[i] = new Vector3(GetRandom(), GetRandom(), GetRandom()); } return scene; }
public static RandomTriangleScene CreateRandomTriangles(int triangleCount) { RandomTriangleScene scene = new RandomTriangleScene(); scene.vertexCount = 3 * triangleCount; scene.colors = new Vector4[scene.vertexCount]; scene.vertices = new Vector3[scene.vertexCount]; for (int i = 0; i < scene.vertexCount; i++) { scene.colors[i] = new Vector4(GetRandom0to1(), GetRandom0to1(), GetRandom0to1(), 0.5f); scene.vertices[i] = new Vector3(GetRandom(), GetRandom(), GetRandom()); } return(scene); }