static void Main( string[] args )
{
try
{
// Analyze arguments
if ( args.Length != 1 )
throw new Exception( "Usage: BRDFSlices \"Path to MERL BRDF\"" );
FileInfo SourceBRDF = new FileInfo( args[0] );
if ( !SourceBRDF.Exists )
throw new Exception( "Source BRDF file \"" + SourceBRDF.FullName + "\" does not exist!" );
// Load the BRDF
Vector3[,,] BRDF = DisplayForm.LoadBRDF( SourceBRDF );
DisplayForm F = new DisplayForm( BRDF );
Application.Run( F );
}
catch ( Exception _e )
{
MessageBox.Show( "An error occurred!\r\n\r\n" + _e.Message + "\r\n\r\n" + _e.StackTrace, "BRDF Fitting", MessageBoxButtons.OK, MessageBoxIcon.Warning );
}
}