我正在使用以下代码在 HelixViewport3D 中绘制球体。现在我想在两个球体之间创建一条线。请有任何建议。
谢谢
var meshBuilder = new MeshBuilder(false, false);
meshBuilder.AddSphere(new Point3D(0, 0, 0), 0.1f, 10, 10);
var mesh = meshBuilder.ToMesh(true);
modelGroup = new Model3DGroup();
var greenMaterial = MaterialHelper.CreateMaterial(Colors.Green);
var insideMaterial = MaterialHelper.CreateMaterial(Colors.Yellow);
mygeometry = new GeometryModel3D();
mygeometry.Material = greenMaterial;
mygeometry.BackMaterial = insideMaterial;
mygeometry.Geometry = mesh;
modelGroup.Children.Add(mygeometry);
myModelVisual3D = new ModelVisual3D();
myModelVisual3D.Content = modelGroup;
myview.Children.Clear();
myview.Children.Add(myModelVisual3D);