Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize dynamic object creation in TE

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to achieve dynamic object creation in TE", the content is easy to understand, clear, hope to help you solve your doubts, let the editor lead you to study and learn "how to achieve dynamic object creation in TE" this article.

Generally, in the development of the system, TE uses CreateDynamicObject under Creator to create dynamic objects, which is encapsulated by sdk, but the adjustment in turning requires some skills.

TE sample, also provides another way of dynamic object creation, and there is an example of JavaScript script code, the idea of creating this dynamic object is to create a model, according to the change of time, dynamically change the location of the model, location change in onframe, the frequency of change is very high, and the effect is more consistent.

The sample JavaScript code is relatively simple, as shown below:

/ / create a default location

Var pos = _ sgworld.Creator.CreatePosition (- 122.38050, / / x

37.62331, / / y

40.0, / / height

3, / / height type

297.0, / / yaw

15.0, / / pitch

0, / / roll

0 / / dist

);

/ / create a model at the default location

Model = _ sgworld.Creator.CreateModel (pos, "D:\\ c5.xpc", 1)

Model.Attachment.AutoDetach = false

/ / fly to the model

_ sgworld.Navigate.FlyTo (model)

/ / implemented in onframe. For details of hooking up onframe, please see api documentation.

Function sOnFrame () {

/ / determine that the model object is not empty

If (model) {

/ / move the model position according to the distance and angle, in the example, move the model in a circle

Var distToMove = (1000 / 3600) * (new Date () .getTime ()-time.getTime ()) / 1000

Model.Position = model.Position.Move (distToMove, model.Position.Yaw + 0.1, model.Position.Pitch)

/ / Update time

Time = new Date ()

}

Effect picture:

These are all the contents of the article "how to create dynamic objects in TE". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report