コード例 #1
0
ファイル: Vizualization.cs プロジェクト: Blairhuang/Culebra
        /// <summary>
        /// Draws Sprites through the display pipeline
        /// </summary>
        /// <param name="args">preview Display Args for IGH_PreviewObjects</param>
        /// <param name="file">the texture file</param>
        /// <param name="particleList">the list of points representing the particle positions</param>
        public void DrawSprites(IGH_PreviewArgs args, string file, List <Point3d> particleList)
        {
            Bitmap bm = new Bitmap(file);

            Rhino.Display.DisplayBitmap         dbm = new Rhino.Display.DisplayBitmap(bm);
            Rhino.Display.DisplayBitmapDrawList ddl = new Rhino.Display.DisplayBitmapDrawList();
            ddl.SetPoints(particleList, Color.FromArgb(255, 255, 255, 255));
            args.Display.DrawSprites(dbm, ddl, 2.0f, new Vector3d(0, 0, 1), true);
        }
コード例 #2
0
 static Rhino.Display.DisplayBitmapDrawList GetItems()
 {
     if (m_items == null)
     {
         m_items = new Rhino.Display.DisplayBitmapDrawList();
         var points = new System.Collections.Generic.List <Point3d>();
         var colors = new System.Collections.Generic.List <System.Drawing.Color>();
         var random = new System.Random();
         for (int i = 0; i < 200; i++)
         {
             double x = random.NextDouble();
             double y = random.NextDouble();
             double z = random.NextDouble();
             points.Add(new Point3d(-30 + x * 60, -30 + y * 60, -30 + z * 60));
             int r = (int)(x * 255);
             int g = (int)(y * 255);
             int b = (int)(z * 255);
             colors.Add(System.Drawing.Color.FromArgb(r, g, b));
         }
         m_items.SetPoints(points, colors);
     }
     return(m_items);
 }
コード例 #3
0
 Rhino.Display.DisplayBitmapDrawList GetItems()
 {
   if (m_items == null)
   {
     m_items = new Rhino.Display.DisplayBitmapDrawList();
     var points = new System.Collections.Generic.List<Point3d>();
     var colors = new System.Collections.Generic.List<System.Drawing.Color>();
     var random = new System.Random();
     for (int i = 0; i < 200; i++)
     {
       double x = random.NextDouble();
       double y = random.NextDouble();
       double z = random.NextDouble();
       points.Add(new Point3d(-30 + x * 60, -30 + y * 60, -30 + z * 60));
       int r = (int)(x * 255);
       int g = (int)(y * 255);
       int b = (int)(z * 255);
       colors.Add(System.Drawing.Color.FromArgb(r, g, b));
     }
     m_items.SetPoints(points, colors);
   }
   return m_items;
 }