private void glControl1_Load(object sender, EventArgs e) { glContextCreated = true; renderer.Init(); renderer.SetModel(model); SetupViewport(); }
private void UpdateModelPanel(int num) { Polymodel model = datafile.Models[num]; txtModelNumModels.Text = model.NumSubmodels.ToString(); txtModelDataSize.Text = model.ModelIDTASize.ToString(); txtModelRadius.Text = model.Radius.ToString(); txtModelTextureCount.Text = model.NumTextures.ToString(); cbModelLowDetail.SelectedIndex = model.SimplerModels; cbModelDyingModel.SelectedIndex = model.DyingModelnum + 1; cbModelDeadModel.SelectedIndex = model.DeadModelnum + 1; txtModelMinX.Text = model.Mins.x.ToString(); txtModelMinY.Text = model.Mins.y.ToString(); txtModelMinZ.Text = model.Mins.z.ToString(); txtModelMaxX.Text = model.Maxs.x.ToString(); txtModelMaxY.Text = model.Maxs.y.ToString(); txtModelMaxZ.Text = model.Maxs.z.ToString(); txtElemName.Text = datafile.ModelNames[num]; if (!noPMView) { Polymodel mainmodel = datafile.Models[(int)ElementSpinner.Value]; modelRenderer.SetModel(mainmodel); glControl1.Invalidate(); } }
private void UpdateModelPanel(int num) { Polymodel model = datafile.replacedModels[(int)nudElementNum.Value]; //Polymodel model = datafile.PolygonModels[num]; txtModelNumModels.Text = model.NumSubmodels.ToString(); txtModelDataSize.Text = model.ModelIDTASize.ToString(); txtModelRadius.Text = model.Radius.ToString(); txtModelTextureCount.Text = model.NumTextures.ToString(); cbModelLowDetail.SelectedIndex = model.SimplerModels; cbModelDyingModel.SelectedIndex = model.DyingModelnum + 1; cbModelDeadModel.SelectedIndex = model.DeadModelnum + 1; /*txtModelMinX.Text = model.mins.x.ToString(); * txtModelMinY.Text = model.mins.y.ToString(); * txtModelMinZ.Text = model.mins.z.ToString(); * txtModelMaxX.Text = model.maxs.x.ToString(); * txtModelMaxY.Text = model.maxs.y.ToString(); * txtModelMaxZ.Text = model.maxs.z.ToString(); * * txtElemName.Text = datafile.ModelNames[num];*/ //if (!noPMView) { modelRenderer.SetModel(model); glControl1.Invalidate(); } UpdateModelTexturePanel(model); }