【问题标题】:Create moving background in live wallpaper using rajawali使用 rajawali 在动态壁纸中创建动态背景
【发布时间】:2014-04-26 19:36:23
【问题描述】:

我正在使用 rajawali 创建动态壁纸。我在其上加载了一个对象(使用此代码:Rajawali object rotation match to camera),现在我想为它在背景中设置动态图像。有没有人给我建议?

【问题讨论】:

    标签: background live-wallpaper rajawali


    【解决方案1】:

    我创建了飞机:

            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();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多