/// <summary> /// Generates a 3D Model for a cuboid /// </summary> /// <param name="Name">Model name</param> /// <param name="u">Length of the lower part</param> /// <param name="v">Length of the high part</param> /// <param name="numberOfPoints">Number of points to use in circumference</param> /// <param name="Color">Color vector</param> /// <param name="Texture">Texture bitmap. Null uses no texture</param> /// <returns></returns> public static PointCloud Cuboid(float u, float v, int numberOfPoints, System.Drawing.Color color) { PointCloud pcl = new PointCloud(); pcl.Vectors = Example3DModels.Cuboid(numberOfPoints, u, v); pcl.SetColor(new Vector3(color.R, color.G, color.B)); return(pcl); }
private void toolStripChangeColor_Click(object sender, EventArgs e) { if (comboModels.SelectedIndex >= 0) { ColorDialog colDiag = new ColorDialog(); // Sets the initial color select to the current text color. // Update the text box color if the user clicks OK if (colDiag.ShowDialog() == DialogResult.OK) { RenderableObject pcr = this.OGLControl.GLrender.RenderableObjects[this.OGLControl.GLrender.SelectedModelIndex]; PointCloud pc = pcr.PointCloud; pc.SetColor(new Vector3(colDiag.Color.R / 255f, colDiag.Color.G / 255f, colDiag.Color.B / 255f)); this.OGLControl.Refresh(); } } else { System.Windows.Forms.MessageBox.Show("Please load a 3D object first"); } }