public model(string path) { this.path = path; this.at = new Point3DF(0, 0, 0); this.scale = new Point3DF(1, 1, 1); this.rotate = new Point3DF(0, 0, 0); }
// Método de rotación private Point3DF RotarXY(Point3DF p1, double ang_x, double ang_y) { // Variables para rotar tanto en X como en Y Point3DF aux = new Point3DF(); Point3DF aux2 = new Point3DF(); double grados_x = (ang_x * Math.PI) / 180; double grados_y = (ang_y * Math.PI) / 180; //Rotacion y aux.X = Convert.ToSingle(p1.X * Math.Cos(grados_x) - p1.Z * Math.Sin(grados_x)); aux.Y = p1.Y; aux.Z = Convert.ToSingle(p1.Z * Math.Cos(grados_x) + p1.X * Math.Sin(grados_x)); //Rotación x aux2.X = aux.X; aux2.Y = Convert.ToSingle(aux.Y * Math.Cos(grados_y) - aux.Z * Math.Sin(grados_y)); aux2.Z = Convert.ToSingle(aux.Z * Math.Cos(grados_y) + aux.Y * Math.Sin(grados_y)); return(aux2); }
private void Form1_Load(object sender, EventArgs e) { fig = new Point3DF[13]; // Dibujar los puntos para empezar a trazar las líneas fig[0] = new Point3DF(0, 30, 0); fig[1] = new Point3DF(10, 30, 0); fig[2] = new Point3DF(10, 25, 0); fig[3] = new Point3DF(8, 23, 0); fig[4] = new Point3DF(8, 15, 0); fig[5] = new Point3DF(15, 5, 0); fig[6] = new Point3DF(0, 100, 0); fig[7] = new Point3DF(0, 100, 0); fig[8] = new Point3DF(0, 100, 0); fig[9] = new Point3DF(0, 100, 0); fig[10] = new Point3DF(0, 100, 0); fig[11] = new Point3DF(0, 100, 0); fig[12] = new Point3DF(0, 100, 0); }
public Point3DF GetPoint3DF() { if ((this.Items != null) && (this.Items.Count >= 3) && (this.Items[0] is SNodeAtom)) { Point3DF result = new Point3DF(); float val = 0; float.TryParse((this.Items[0] as SNodeAtom).Value, out val); result.X = val; val = 0; float.TryParse((this.Items[1] as SNodeAtom).Value, out val); result.Y = val; val = 0; float.TryParse((this.Items[2] as SNodeAtom).Value, out val); result.Z = val; return(result); } else { return(new Point3DF(0, 0, 0)); // error } }