private void BtnOpenUrl_Click(object sender, RoutedEventArgs e) { Controller.RunOnNextDraw.Add(() => { var fileName = URL; var objFM = new ObjFileModel(fileName); Controller.AddData(objFM.Indices, objFM.Vertices.Select(x => x.ToVec3()).ToArray(), objFM.Normals); }); }
private void BtnOpen_Click(object sender, RoutedEventArgs e) { var ofDlg = new OpenFileDialog(); // Set filter for file extension and default file extension ofDlg.DefaultExt = ".obj"; ofDlg.Filter = "OBJ WaveFront (.obj)|*.obj"; var res = ofDlg.ShowDialog(); if (res == true) { Controller.RunOnNextDraw.Add(() => { var fileName = ofDlg.FileName; var objFM = new ObjFileModel(fileName); Controller.AddData(objFM.Indices, objFM.Vertices.Select(x => x.ToVec3()).ToArray(), objFM.Normals); }); } }
public void AddMonkey() { var objFM = new ObjFileModel("C:\\Users\\Jochem\\Desktop\\monkey.obj"); AddData(objFM.Indices, objFM.Vertices.Select(x => x.ToVec3()).ToArray(), objFM.Normals); }