0

Android 용 wikitude SDK에서 성공적인 이미지 인식 후 대상 이미지 위에 하나의 이미지를 표시하려고합니다.Wikitude SDK (Android Native)는 대상 이미지가 인식 된 후 오버레이 이미지를 표시합니다.

enter image description here

은 기본적으로는 StrokedRectangle을 보이고있다. 이미지를 표시하는 방법에 대한 문서에서 명확한 아이디어를 찾을 수 없었습니다. 그래서 몇 가지 제안을 주시면 감사하겠습니다.

답변

1

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 플러그인.

+0

확인. Wikitude JS SDK를 살펴 보겠다. – fida1989