我目前正尝试使用Rajawali(OpenGL Framework)在Android(SDK 19)上实现增强现实。创建2D / 3D对象并将相机场景颜色更改为红色,绿色等,到目前为止运作良好。但现在我想使用改变相机场景颜色的可能性来以灰色显示相机场景。
到目前为止我所拥有的:
public void setupCamera (int color) {
ScreenQuad backgroundQuad = new ScreenQuad();
Material cameraMaterial = new Material();
cameraMaterial.setColor(color);
cameraMaterial.setColorInfluence(1f);
// We need to use Rajawali's {@code StreamingTexture} since it sets up the texture
// for GL_TEXTURE_EXTERNAL_OES rendering
mCameraTexture =
new StreamingTexture("camera", (StreamingTexture.ISurfaceListener) null);
try {
cameraMaterial.addTexture(mCameraTexture);
backgroundQuad.setMaterial(cameraMaterial);
} catch (ATexture.TextureException e) {
Log.e(TAG, "Exception creating texture for RGB camera contents", e);
}
getCurrentScene().addChildAt(backgroundQuad, 0);
}
到目前为止我尝试了什么:
乍一看,似乎 .setColor(color)需要一个RGB值(十六进制0x00000000),而前两个字节代表alpha通道。但是将所有值设置为这样的值:0x00666666只会使相机场景变亮。将值设置为0x00ffffff会使摄像机场景接近白色,而0x00000000会使其稍微变暗。
有什么建议吗?