Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AR_logo.obj not rendering with any texture for World Activity #8

Open
muizamhailey004 opened this issue Jun 18, 2021 · 2 comments
Open

Comments

@muizamhailey004
Copy link

I used the sample code and didn't change anything. When I render the object, the AR logo appears blue in colour. When I double tap it, it becomes yellow. Shouldn't it be orange in colour due to AR_logo.jpg?
photo6224201047438634350

I've tried to comment out initGlTextureData(context) in ObjectDisplay.java as such.

` public void init(Context context) {
ShaderUtil.checkGlError(TAG, "Init start.");
createProgram();

    // Coordinate and index.
    int[] buffers = new int[2];
    GLES20.glGenBuffers(2, buffers, 0);
    mVertexBufferId = buffers[0];
    mIndexBufferId = buffers[1];
    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glGenTextures(mTextures.length, mTextures, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextures[0]);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR_MIPMAP_LINEAR);
    //initGlTextureData(context);
    initializeGlObjectData(context);
    ShaderUtil.checkGlError(TAG, "Init end.");
}`

However, still same result. Any fix to this?

I've also tried to use other .obj and .png files, but still the same issue. Thanks in advance!

@Mike-mei
Copy link
Contributor

You can check the file WorldRenderManager.java from the Demo code of AREngine, and there are 2 methods: doWhenEventTypeDoubleTap and doWhenEventTypeSingleTap.
When single tap the screen, it will render the model with blue color, as in the picture you showed. And when double tap, it will render with the texture file, which is initialized in the ObjectDisplay.java file

@muizamhailey004
Copy link
Author

Right now my target is to change the texture file and model file. I've tried keeping the AR_logo.obj and changing the .png file to some other texture. Hence, the expected outcome will be the AR logo, but rendered with a different texture on double tap. However, still the same old orange texture. Why is that so?

I've also tried to make the model render with some other colour instead of blue, by changing the value of BLUE_COLORS in WorldRenderManager.java. It still renders as blue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants