private void Form1_Load(object sender, EventArgs e) { phid = new Spatial(); phid.Attach += new AttachEventHandler(phid_Attach); phid.Detach += new DetachEventHandler(phid_Detach); phid.Error += new Phidgets.Events.ErrorEventHandler(phid_Error); phid.SpatialData += new SpatialDataEventHandler(phid_SpatialData); p = new Pipeline(); //Choose shape and zoom p.fillVertices("shape.obj"); initialZoom = 8000; //zoom //p.fillVertices("teapot.obj"); //initialZoom = 2500; //zoom trackBar4.Value = initialZoom; origin = new Point(pictureBox1.Width / 2, pictureBox1.Height / 2); pictureBox1.Image = p.Draw(origin, positions.Z); phid.open(); }