开发者

Programmatically creating a WPF 3D cube

What is the simple开发者_如何学Cst way to programmatically create a GeometryModel3D cube in wpf?


The simplest method? It all depends on your point of view.

I'd say this kind of thing is pretty "simple":

return new GeometryModel3D
{
  Material = ...,
  Geometry = new Geometry
  {
    Points = new Point3DCollection
    {
      new Point3D(0,0,0),
      ...
    },
    TriangleIndices = new Int32Collection
    {
      ...
    },
    ...
  },
  ...
};

But others might consider a single call to XamlReader.Parse("...put your xaml here...") as more simple.

It's a judgement call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜