[英]Import any 3d file at runtime in WPF
I asked a similair question earilier, but it was not generic enough, so here's another attempt. 我较早地问了一个类似的问题,但这还不够通用,所以这是另一种尝试。
I currently have a whole bunch of 3d .obj and .jpg files which I want to display in my WPF application. 我目前有一堆3d .obj和.jpg文件,这些文件要显示在WPF应用程序中。 However, I want to do this at runtime, so converting them using Blend is not an option.
但是,我想在运行时执行此操作,因此不能选择使用Blend进行转换。
I don't mind having to convert to other types of 3d files, as long as this can be done at runtime (either programmaticly or by using a command line tool). 我不介意转换为其他类型的3d文件,只要可以在运行时完成(通过编程或使用命令行工具)即可。
So I guess my question is: Is there any way to import a 3d file in WPF at runtime? 所以我想我的问题是:有什么方法可以在运行时在WPF中导入3d文件吗?
Thanks! 谢谢!
I don't think there's a built in way. 我认为没有内置的方式。 You'll most likely have to write an importer for your own specific needs.
您很可能必须为自己的特定需求编写一个导入程序。 You can find some file format information here> http://en.wikipedia.org/wiki/Wavefront_.obj_file
您可以在此处找到一些文件格式信息> http://en.wikipedia.org/wiki/Wavefront_.obj_file
Thanks to @MattDavey 感谢@MattDavey
I managed to get The HelixToolkit (http://helixtoolkit.codeplex.com/) to work and got what I wanted using the ModelImporter.Load method. 我设法使HelixToolkit(http://helixtoolkit.codeplex.com/)正常工作,并使用ModelImporter.Load方法获得了我想要的东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.