0

このようなHelixツールキングを使用して3Dモデルをロードしました

modelGroupScull = importer.Load("C:\\Users\\Robert\\Desktop\\a.obj");
GeometryModel3D modelScull = (GeometryModel3D)modelGroupScull.Children[0];

また、3D 空間でポイント ツー ポイントから線を描画できる _3DTools もあります。GeometryModel3D のワイヤーフレームを描画するには、その頂点に循環して ScreenSpaceLines3D に追加する必要があると思います。

ScreenSpaceLines3D wireframe = new ScreenSpaceLines3D();

// need to cycle through all vertexes of modelScull as Points, to add them to wireframe
wireframe.Points.Add(new Point3D(1, 2, 3));


wireframe.Color = Colors.LightBlue;
wireframe.Thickness = 3;

Viewport3D1.Children.Add(wireframe);

しかし...どうすればこの頂点ポイントを実際に取得できますか?

編集:

答えてくれてありがとう。それはポイントを追加しました

        ScreenSpaceLines3D wireframe = new ScreenSpaceLines3D();

        MeshGeometry3D mg3 = (MeshGeometry3D)modelScull.Geometry;

        foreach (Point3D point3D in mg3.Positions)
        {
            wireframe.Points.Add(point3D);
        }


        wireframe.Color = Colors.LightBlue;
        wireframe.Thickness = 1;

        Viewport3D1.Children.Add(wireframe);

しかし、ワイヤーフレームは台無しです )

ここに画像の説明を入力
(出典:gyazo.com

誰かがワイヤーフレームを描画する他の方法を知っているでしょうか? )

4

2 に答える 2

1

MeshGeometry3D.Positions プロパティで頂点を見つける必要があります。

foreach (var point3D in modelScull.Geometry.Positions)
于 2013-09-15T12:51:00.910 に答える