Wikitude Native SDK는 카메라와 평가판 워터 마크 만 렌더링합니다. StrokedRectangle은 예제 앱의 일부입니다.
OpenGL을 사용하여 이미지를 그려야합니다. 어쩌면이 tutorial가 도움이 될 것입니다. 당신이 OpenGL을 함께 편안하지 않으면
attribute vec4 v_position;
uniform mat4 Projection; // from ImageTarget
uniform mat4 ModelView; // from ImageTarget
uniform mat4 Scale; // create scale matrix based on ImageTarget.getTargetScale
void main()
{
gl_Position = Projection * ModelView * Scale * v_position;
};
당신이 시도 할 수있는 위키 튜드 (Wikitude) JS SDK 나 :
public static int loadTexture(final Context context, final int resourceId)
{
final int[] textureHandle = new int[1];
GLES20.glGenTextures(1, textureHandle, 0);
if (textureHandle[0] != 0)
{
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inScaled = false; // No pre-scaling
// Read in the resource
final Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resourceId, options);
// Bind to the texture in OpenGL
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]);
// Set filtering
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
// Load the bitmap into the bound texture.
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0);
// Recycle the bitmap, since its data has been loaded into OpenGL.
bitmap.recycle();
}
if (textureHandle[0] == 0)
{
throw new RuntimeException("Error loading texture.");
}
return textureHandle[0];
}
이
는 텍스처 후 배치 할 수있는 방법을 표시하는 위키 튜드 (Wikitude) 예제 응용 프로그램에서 버텍스 쉐이더입니다 Unity 플러그인.
확인. Wikitude JS SDK를 살펴 보겠다. – fida1989