public class MyRenderer extends RajawaliCardboardRenderer
{
public MyRenderer(Context context)
{
super(context);
}
@Override
public void initScene() {
Log.d("debug1","initScene()");
Sphere sphere = createPhotoSphereWithTexture(new Texture("photo",R.drawable.image));
getCurrentScene().addChild(sphere);
getCurrentCamera().setPosition(Vector3.ZERO);
getCurrentCamera().setFieldOfView(75);
}
private static Sphere createPhotoSphereWithTexture(ATexture texture) {
Material material = new Material();
material.setColor(0);
try {
material.addTexture(texture);
} catch (ATexture.TextureException e) {
throw new RuntimeException(e);
}
Sphere sphere = new Sphere(50, 64, 32);
sphere.setScaleX(-1);
sphere.setMaterial(material);
return sphere;
}
}
目前在 RajawaliVR 库中预加载了一个固定图像。用于设置图像的方法在开始时只调用一次。我想更改遗嘱上的图像。任何熟悉使用 rajawaliVR 库的人都会知道我在问什么,在此先感谢。