我正在尝试在我的标记上显示简单的2D图像。我找到了如何在标记上创建立方体的解决方案。
public void draw(GL10 gl) {
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
// Apply the ARToolKit projection matrix
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadMatrixf(ARToolKit.getInstance().getProjectionMatrix(), 0);
gl.glEnable(GL10.GL_CULL_FACE);
gl.glShadeModel(GL10.GL_SMOOTH);
gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glFrontFace(GL10.GL_CW);
// If the marker is visible, apply its transformation, and draw a cube
if (ARToolKit.getInstance().queryMarkerVisible(markerID)) {
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadMatrixf(ARToolKit.getInstance().queryMarkerTransformation(markerID), 0);
cube.draw(gl);
}
如何更改上述代码以达到预期效果?