Exemple #1
0
        public async Task Run(string inputFile, string outputFile)
        {
            var @object = new ObjParser(await File.ReadAllTextAsync(inputFile)).ToGroup().ToMesh();

            @object.Transform(Matrix.RotationX(MathF.PI / 2).Scale(5, 5, 5));

            var scene = _sceneProvider.GetScene();

            scene.Objects.Add(@object);

            var image = _rayTracer.Render(scene);
            var sr    = new StreamWriter($"{Path.GetFileNameWithoutExtension(outputFile)}.ppm");
            await image.ToPpmAsync(sr.BaseStream);
        }