简体   繁体   English

Android-存储或创建3D模型

[英]Android - Storing 3d models or creating them

Which is best for Android? 哪个最适合Android?

I have 30 3D models but there is only ever one drawn on the screen at any time. 我有30个3D模型,但任何时候在屏幕上都只能绘制一个。

Do I: 我要:

  • create the model and destroy the previous model every time the displayed one changes. 每次显示的模型更改时,创建模型并销毁先前的模型。

or 要么

  • create all 30, store them and just reference them when I want to draw them. 创建所有30个,存储它们,并在我要绘制它们时引用它们。

Note that when one model is removed another model appears and the transition must be smooth. 请注意,当删除一个模型时,将出现另一个模型,并且过渡必须平滑。

In what context would one be better than the other? 在什么情况下一个会比另一个更好?

Have you tried loading all of them at once? 您是否尝试过一次加载所有这些? Start with that, and if it doesn't work, then look at memory management. 开始了,并且如果它不工作, 然后看看内存管理。 You should be able to keep at least three or four models in memory on an older device. 您应该能够在较旧的设备上将至少三个或四个模型保留在内存中。 If you do have issues with ram, try to predict which models are going to be used next, and pre-load them in. 如果ram确实有问题,请尝试预测下一个将要使用的模型,然后将其预先加载。

Keeping them all loaded is normally preferable, because it means your app will appear fluid and responsive. 通常最好保持它们全部加载,因为这意味着您的应用程序将显得流畅且响应迅速。

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

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