Unable to add 2D Image or 3D object on Target iOS Objective C

0 votes
asked Mar 7, 2018 by lakshminaidu (120 points)
edited Mar 7, 2018 by lakshminaidu

I have tried to add Image as texture which not working.

I have tried to add obj file  as texture which not working.

float * modelViewProjection = calloc(16, sizeof(float));

            float * translateData = calloc(16, sizeof(float));

            float * scaleData = calloc(16, sizeof(float));

            

            translateData = translatePoseMatrix(texture.x, texture.y, texture.z, cameraview_data);

            scaleData = scalePoseMatrix(texture.xScale,texture.yScale,texture.zScale,translateData);

            modelViewProjection = multiplyMatrix(projectionMatrix_data,scaleData,modelViewProjection);

           

            

            glActiveTexture(GL_TEXTURE0);

            glBindTexture(GL_TEXTURE_2D, texture.textureID);

            glUniformMatrix4fv(pos_trans_box, 1, GL_FALSE, translateData);

            glUniformMatrix4fv(pos_proj_box, 1, GL_FALSE, modelViewProjection);

            glDrawElements(GL_TRIANGLES, 4,

                                  GL_UNSIGNED_SHORT, quadIndices);

///Texture

GLuint textureID;

                glGenTextures(1, &textureID);

                [texture setTextureID:textureID];

                glBindTexture(GL_TEXTURE_2D,textureID);

                glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

                glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

                glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, [texture width], [texture height], 0, GL_RGB, GL_UNSIGNED_BYTE, (GLvoid*)[texture pngData]);

App is crashing on render frame with viewport

gpus_ReturnGuiltyForHardwareRestart + 12
1 libGPUSupportMercury.dylib 0x000000018e8aef3c gpusSubmitDataBuffers + 168
2 AGXGLDriver 0x000000018402445c agxuFinishContextResource + 100
3 AGXGLDriver 0x00000001840179bc glrWriteTextureData + 912
4 libGPUSupportMercury.dylib 0x000000018e8b59d0 gldModifyTexSubImage + 416
5 GLEngine 0x000000018957c4b8 glTexImage2D_Exec + 2084
6 OpenGLES 0x000000018966293c glTexImage2D + 104
7 BTSmartHubApp 0x00000001001227d0 0x100088000 + 632784
8 BTSmartHubApp 0x000000010008fa74 0x100088000 + 31348
9 GLKit 0x0000000186984038 -[GLKView _display:] + 180
10 GLKit 0x00000001869853d8 -[GLKViewController _updateAndDraw] + 548

Please help

Please log in or register to answer this question.

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...