我想在动态壁纸中加载3d .obj文件并对其进行动画处理。我使用RAJAWALI库来加载它。问题是3d obj文件加载和动画成功,但加载背景图像不加载一些Android设备。代码如下:加载3d .obj文件,并添加背景图像在android动态壁纸?
protected void initScene() {
DirectionalLight localDirectionalLight = new DirectionalLight(0.0F, 0.6F, 0.4F);
localDirectionalLight.setPower(3.0F);
PointLight mLight = new PointLight();
mLight.setPosition(0, 0, 0);
mLight.setPower(13);
Plane plane = new Plane(70, 70, 1, 1, 1);
plane.addLight(mLight);
plane.setMaterial(new SimpleMaterial());
plane.addTexture(mTextureManager.addTexture(BitmapFactory.decodeResource(mContext.getResources(), R.drawable.pozadina)));
addChild(plane);
plane.setZ(10);
try
{
ObjParser localObjParser = new ObjParser(this.mContext.getResources(), this.mTextureManager, R.raw.allah);
localObjParser.parse();
this.strela = localObjParser.getParsedObject();
this.strela.addLight(localDirectionalLight);
if (this.tekstura == null)
{
BitmapFactory.Options localOptions2 = new BitmapFactory.Options();
localOptions2.inPurgeable = true;
this.strela.setColor(Color.WHITE);
}
this.strela.setScale(2.0F);
addChild(this.strela);
this.mCamera.setPosition(0.0F, 0.0F, -50.0F);
this.mCamera.setFarPlane(1000.0F);
Number3D localNumber3D = new Number3D(0.0F, 1.0F, 0.0F);
localNumber3D.normalize();
this.mAnim = new RotateAnimation3D(localNumber3D, 360.0F);
this.mAnim.setDuration(10000L);
this.mAnim.setRepeatCount(-1);
this.mAnim.setTransformable3D(this.strela);
return;
}
catch (Exception localException)
{
while (true)
localException.printStackTrace();
}
}
它给SAMSUNG NEXUS android v4.1的问题。
请帮助我该怎么做?
你有没有解决这个问题? – 2013-04-03 05:20:08