protected void WriteToVoxFile() { var rawOutput = Model.GetOutput(); var voxels = VoxReaderWriter.TransformOutputToVox(rawOutput); VoxReaderWriter.WriteVoxelFile(outVoxFileName, rawOutput.GetLength(0), rawOutput.GetLength(1), rawOutput.GetLength(2), voxels); Debug.Log($"Model written to {outVoxFileName}.vox !"); }
protected InputModel Init() { //Read the .vox file var inputModel = VoxReaderWriter.ReadVoxelFile(voxFileName); //Display the voxel model. inputVoxelModelObj = Instantiate(Resources.Load("Prefabs/VoxelModel")) as GameObject; var voxModel = inputVoxelModelObj?.GetComponent <VoxelModel>(); voxModel?.Display(inputModel.Voxels); //Center the 3D model and init grid voxModel.transform.position = Vector3.zero; return(inputModel); }