我不熟悉 Rajawali,但是当我刚刚查看时,加载远程纹理并将其应用到模型似乎相当容易。
我认为您已经加载了 3D 模型并且可以很好地显示它。如果是这样,您应该采取以下基本步骤(通常适用于所有 3D 建模应用程序):
Rajawali 中有一个类Texture,它从位图图像创建纹理对象。因此,您应该首先从服务器下载该图像。下载过程与 Rajawali 概念不同,因此您可以通过许多现有的库来完成它。
下载完图像后,您可以将其提供给班级Texture。
Texture mytexture = new Texture("texture", /*address to the downloaded image*/);
Run Code Online (Sandbox Code Playgroud)
然后,您应该将其添加到材质中
try {
material.addTexture(mytexture);
} catch (ATexture.TextureException error){
Log.d(TAG, "Error Occurred");
}
Run Code Online (Sandbox Code Playgroud)
现在,您可以将此材质应用到模型中
model.setMaterial(material);
Run Code Online (Sandbox Code Playgroud)