Skyline Desktop Two-time development path Roaming (C #)

Source: Internet
Author: User

The so-called path roaming: Create a dynamic object and a multi-point line, and then let the dynamic object fly along the line

First draw a line, actually the path roaming is not need to draw the line, I just to confirm whether the dynamic object is flying along the line, the code is as follows:

Draw path            double[] Cverticesarray = null;            Cverticesarray = new double[] {                        116.35,  27.98,  0,                        116.45,  28.98,  0,                        116.45,  28.11,  0,                        116.65,  28.45,  0,                     };            Ilinestring pilinestring = SgWorld.Creator.GeometryCreator.CreateLineStringGeometry (Cverticesarray);            IColor66 color = sgWorld.Creator.CreateColor (255, 0, 0,);            var polyline = sgWorld.Creator.CreatePolyline (pilinestring, color);

Next, create the dynamic object with the following code:

var dynamicobject = this.sgWorld.Creator.CreateDynamicObject (0, Dynamicmotionstyle.motion_ground_vehicle, Dynamicobjecttype.dynamic_image_label, @ "f:\ project management \ Wisdom Fuzhou \ Use of fly\data11\ car icon \ Whole vehicle. png", altitudetypecode.atc_ Terrain_relative, "", "dynamic Object");

Parameter description:

First parameter 0: A set of IRouteWaypoint66 objects that are subsequently added to the dynamic object

a second parameter Dynamicmotionstyle: Move Way, is an enumeration type, concrete effect you can try it .

a third parameter Dynamicobjecttype: A Dynamic object type, which is an enumeration type that also determines the file type of your fourth parameter

Fourth parameter: Because of the third parameter selection of the Image_label, here I chose a picture

Fifth parameter 50: size of File Scaling

Sixth parameter Altitudetypecode: Height mode

Once the dynamic object is created, the inflection point of the path is created, and the code is as follows:

var wayPoint1 = This.sgWorld.Creator.CreateRouteWaypoint (116.35, 27.98, 0, +);            var wayPoint2 = This.sgWorld.Creator.CreateRouteWaypoint (116.45, 28.98, 0, +);            var wayPoint3 = This.sgWorld.Creator.CreateRouteWaypoint (116.55, 28.11, 0, +);            var wayPoint4 = This.sgWorld.Creator.CreateRouteWaypoint (116.65, 28.45, 0, 800);

Then add the inflection point to the dynamic object:

            DynamicObject.Waypoints.AddWaypoint (wayPoint1);            DynamicObject.Waypoints.AddWaypoint (WayPoint2);            DynamicObject.Waypoints.AddWaypoint (WAYPOINT3);            DynamicObject.Waypoints.AddWaypoint (WAYPOINT4);            Dynamicobject.circularroute = false;            Dynamicobject.restartroute (0);

The last call to fly to the object, you can achieve the path roaming effect:

SgWorld.Navigate.FlyTo (Dynamicobject.id, actioncode.ac_jump);

  

Skyline Desktop Two-time development path Roaming (C #)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.