Exemple #1
0
        public bool IntersectTriangle(Plane3D Plane)
        {
            Vector3 boxcenter   = 0.5 * (Max + Min);
            Vector3 boxhalfsize = 0.5 * (Max - Min);

            return(Utils3D.triBoxOverlap(boxcenter.Array, boxhalfsize.Array, Plane.Vertex) > 0);
        }
Exemple #2
0
        public override void OnMouseDown(int int_0, int int_1, int int_2, int int_3)
        {
            IPoint point = Utils3D.XYToPoint(this._plugin.SceneGraph, int_2, int_3);

            if (point != null)
            {
                point.Z = this.isurface_0.GetElevation(point);
                FlyByUtils.AddFlyByGraphic(this._plugin.SceneGraph, point, FlyByUtils.FlyByElementType.FLYBY_ANCHORS, System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red, false);
                Utils3D.FlashLocation3D(this._plugin.SceneGraph, point);
                if (this.ipointCollection_0 == null)
                {
                    this.ipointCollection_0 = new Polyline();
                }
                object value = Missing.Value;
                this.ipointCollection_0.AddPoint(point, ref value, ref value);
                if (this.ipointCollection_0.PointCount > 1)
                {
                    IPolyline polyline = (this.ipointCollection_0 as IClone).Clone() as IPolyline;
                    Utils3D.MakeZMAware(polyline, true);
                    double maxSegmentLength = polyline.Length / 50.0;
                    if (this.ipointCollection_0.PointCount > 2)
                    {
                        polyline.Smooth(0.0);
                        polyline.Densify(maxSegmentLength, 0.0);
                    }
                    FlyByUtils.AddFlyByGraphic(this._plugin.SceneGraph, polyline, FlyByUtils.FlyByElementType.FLYBY_PATH, System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red, true);
                }
            }
        }
Exemple #3
0
        public void CreateInitialRays(Vector3 Pos, int Details = 10)
        {
            InitialRays.Clear();

            for (int i = 0; i < Details; ++i)
            {
                for (int j = 0; j < Details; ++j)
                {
                    double Phi1 = Utils2D.I2Diap(i, Details, 0, Math.PI * 2);
                    double Phi2 = Utils2D.I2Diap(i + 1, Details, 0, Math.PI * 2);

                    double The1 = Utils2D.I2Diap(j, Details, -Math.PI, Math.PI);
                    double The2 = Utils2D.I2Diap(j + 1, Details, -Math.PI, Math.PI);

                    double x1, x2, x3, x4;
                    double y1, y2, y3, y4;
                    double z1, z2, z3, z4;

                    double r = 50;
                    Utils3D.SphToXYZ(r, Phi1, The1, out x1, out y1, out z1);
                    Utils3D.SphToXYZ(r, Phi2, The1, out x2, out y2, out z2);
                    Utils3D.SphToXYZ(r, Phi1, The2, out x3, out y3, out z3);
                    Utils3D.SphToXYZ(r, Phi2, The2, out x4, out y4, out z4);

                    Tube3D t = new Tube3D();

                    t.Rays[0].Begin = Pos + Vector3.xAxis * 0.005;
                    t.Rays[1].Begin = Pos + Vector3.yAxis * 0.005;
                    t.Rays[2].Begin = Pos;

                    t.Rays[0].End = new Vector3(x1 + Pos.X, y1 + Pos.Y, z1 + Pos.Z);
                    t.Rays[1].End = new Vector3(x2 + Pos.X, y2 + Pos.Y, z2 + Pos.Z);
                    t.Rays[2].End = new Vector3(x3 + Pos.X, y3 + Pos.Y, z3 + Pos.Z);

                    InitialRays.Add(t);

                    /*
                     *  Gl.glNormal3d(nx, ny, nz);
                     * Gl.glVertex3d(x1, y1, z1);
                     * Gl.glVertex3d(x2, y2, z2);
                     * Gl.glVertex3d(x3, y3, z3);
                     *
                     * NormalToVector(x2, y2, z2, x3, y3, z3, x4, y4, z4, out nx, out ny, out nz);
                     *
                     * Gl.glNormal3d(nx, ny, nz);
                     * Gl.glVertex3d(x2, y2, z2);
                     * Gl.glVertex3d(x3, y3, z3);
                     *
                     * Gl.glVertex3d(x4, y4, z4);*/
                }
            }
        }
Exemple #4
0
        public override void OnMouseDown(int int_0, int int_1, int int_2, int int_3)
        {
            IPoint point = Utils3D.XYToPoint(this._plugin.SceneGraph, int_2, int_3);

            if (point != null)
            {
                point.Z = this.isurface_0.GetElevation(point);
                FlyByUtils.DeleteFlyByElement(this._plugin.SceneGraph, FlyByUtils.FlyByElementType.FLYBY_STATIC, false);
                FlyByUtils.AddFlyByGraphic(this._plugin.SceneGraph, point, FlyByUtils.FlyByElementType.FLYBY_STATIC, System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red, System.Drawing.Color.Red, true);
                Utils3D.FlashLocation3D(this._plugin.SceneGraph, point);
                ToolSceneDrawFlyByPath.m_frm.StaticLoc = point;
            }
        }