使用拉贾瓦利在动态壁纸中创建移动背景



我正在使用rajawali创建动态壁纸。我在上面加载了一个对象(使用以下代码:Rajawali 对象旋转与相机匹配),现在我想在背景中为其设置移动图像。有人给我建议吗?

我创建了平面:

        mPlane1 = new Plane();
    Material material1 = new Material();
    try {
        material1.addTexture(new Texture("cloud2", R.drawable.cloud2));
    } catch (TextureException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    material1.setColorInfluence(0);
    mPlane1.setMaterial(material1);
    mPlane1.setRotY(180);
    mPlane1.setTransparent(true);
    mPlane1.setPosition(Vector3.X);
    mPlane1.setPosition(-1.6f, 1.2, 1.6);
    getCurrentScene().addChild(mPlane1);

并使用 TranslateAnimation3D 进行翻译:

plane1Anim = new TranslateAnimation3D(Vector3.X);
    plane1Anim.setRepeatMode(RepeatMode.INFINITE);
    plane1Anim.setTransformable3D(mPlane1);
    plane1Anim.setDuration(16000);
    getCurrentScene().registerAnimation(plane1Anim);
    plane1Anim.play();

最新更新