In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Xiaobian to share with you how to create a camera vision in TE development, I believe most people still do not know how, so share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!
In a three-dimensional system, information from the camera is sometimes hooked up to simulate the field of view of the real camera, simulate the movement of the camera up and down in three dimensions, and simulate zooming in the field of view of the camera.
Here is the C#code implementation:
//mouse click to get position, set height to relative
IWorldPointInfo6 Iworldinfo = sgworld.Window.PixelToWorld(X, Y, WorldPointType.WPT_DEFAULT);
Iworldinfo.Position.AltitudeType = AltitudeTypeCode.ATC_TERRAIN_RELATIVE;
Iworldinfo.Position.Altitude = 10;
//Create a model of the camera
ITmodel = sgworld.Creator.CreateModel(Iworldinfo.Position, Model file path, 1, ModelTypeCode.MT_NORMAL, 0, "shipin");
//Set the camera's upward viewing angle
Iworldinfo.Position.Pitch = -90;
rtapos = Iworldinfo.Position.Copy();
//Create color
IColor6 crtcolor = sgworld.Creator.CreateColor(Color.LightBlue.R, Color.LightBlue.G, Color.LightBlue.B, 120);
//Create a cone effect
ITeRegBase = sgworld.Creator.CreateCone(Iworldinfo.Position, 2, 5, crtcolor, crtcolor, -1, 0, "shizhui");
//bind the cone to the model and fly it to the model
ITeRegBase.Attachment.AttachTo(ITemodel.ID, 0, 5, 0);
sgworld.Navigate.FlyTo(ITemodel);
//Left shift of camera and vertebral body
ITemodel.Position.Yaw += 10;
ITeRegBase.Position.Pitch = rtapos.Pitch;
ITeRegBase.Position.Yaw += 10;
//camera and vertebral contraction
ITeRegBase.Height += 1;
ITeRegBase.Attachment.AttachTo(ITemodel.ID, 0, ITeRegBase.Height,
0);
ITeRegBase.Position.Pitch = rtapos.Pitch;
ITeRegBase.Radius -= 0.3;
//Top view of camera and vertebral body
if (rtapos.Pitch > -130.0 && rtapos.Pitch < -35.0)
{
rtapos.Pitch -= 9;
ITeRegBase.Position.Pitch = rtapos.Pitch;
ITeRegBase.Attachment.AttachTo(ITemodel.ID, 0,
ITeRegBase.Height, 0);
ITemodel.Position.Pitch -= 9;
}
Camera effect:
The above is all the content of this article "How to create camera vision in TE development", thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.