编程方式创建一个WPF 3D魔方 [英] Programatically creating a WPF 3D cube

查看:324
本文介绍了编程方式创建一个WPF 3D魔方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最简单的方式为编程创建GeometryModel3D立方体在WPF?

What is the simplest way to programatically create a GeometryModel3D cube in wpf?

推荐答案

简单的方法?这一切都取决于你的观点。

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

我说这种事情是pretty的简单:

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
    {
      ...
    },
    ...
  },
  ...
};

但其他人可能会考虑到 XamlReader.Parse一个呼叫(......把你的XAML这里...)更简单。

这是一个主观判断。

这篇关于编程方式创建一个WPF 3D魔方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆