简体   繁体   English

如何在android中显示3D模型?

[英]How to display 3D models in android?

I want to display some 3D models (.obj files) in an android app using android studio.我想在使用 android studio 的 android 应用程序中显示一些 3D 模型(.obj 文件)。

The user enters some data and the models have to be placed relative to each other according to the user input.用户输入一些数据,模型必须根据用户输入相对于彼此放置。

So all I need is to display some 3D models placed relative to each other according to the data entered before, and the user will be able to see the models from any direction when swiping the screen.所以我只需要根据之前输入的数据显示一些相对放置的3D模型,用户可以在滑动屏幕时从任何方向看到模型。

I don't know how to achieve this .我不知道如何实现这一目标 I tried to use OpenGL-ES, but without avail as I can't find enough tutorials and the documentation is hard to be understood.我尝试使用 OpenGL-ES,但无济于事,因为我找不到足够的教程,而且文档很难理解。

Any help or suggestion is welcome.欢迎任何帮助或建议。

Thanks in advance.提前致谢。

Found this 3D Viewer on GitHub (supports OBJ, GLTF)在 GitHub 上找到了这个 3D 查看器(支持 OBJ、GLTF)

Also, I believe it is possible to find some converters OBJ ~> GLTF (by Khronos).另外,我相信可以找到一些转换器 OBJ ~> GLTF(由 Khronos)。 You can write Android App with embedded Web View in which you can show GLTF.您可以编写带有嵌入式 Web 视图的 Android 应用程序,您可以在其中显示 GLTF。

If someone will work on Android app using some HTML / JS framework like Phonegap or VueJS + Quasar, then GLTF could be good way to go (if OBJ ~> GLTF is not a problem).如果有人将使用一些 HTML/JS 框架(如 Phonegap 或 VueJS + Quasar)在 Android 应用程序上工作,那么 GLTF 可能是个好方法(如果 OBJ ~> GLTF 不是问题)。

You can use for this job SceneForm .您可以使用此作业SceneForm In a nutshell SceneForm is used as a middleware between ARCore and Filament to create awesome Augmented Reality Apps, but you can also use SceneForm just to visualize GLTF-Models简而言之,SceneForm 用作 ARCore 和 Filament 之间的中间件来创建很棒的增强现实应用程序,但您也可以使用 SceneForm 来可视化GLTF 模型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM