Log in or register to post comments

replace 3d model

May 28, 2013 - 9:31pm #9

hii moderator... 

how can i replace 3d model at the ImageTargets sample ?
I've change *.obj file to *.h and include into ImageTargets.cpp in /jni directory
I've change "input data" and "draw data"

//input data
glVertexPointer(3, GL_FLOAT, 0, comidaVerts);
glNormalPointer(GL_FLOAT, 0, comidaNormals);
glTexCoordPointer(2, GL_FLOAT, 0, comidaTexCoords);
//draw data
glDrawArrays(GL_TRIANGLES, 0, comidaNumVerts);
 
and last I've comipe with ndk-build..
no error message
 
but when I tracking chips image, the screen back to about screen
please help me

replace 3d model

May 28, 2013 - 10:33pm #8

Hi, the code that you posted is only valid in OpenGL ES 1.1;

by default the samples use OpenGL ES 2.0;

you should modify the code for 2.0; see the lines starting with glVertexAttribPointer( ... ), and set your verrtex arrays there.

 

replace 3d model

May 28, 2013 - 11:26pm #7

do you mean like this ?

glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
                        (const GLvoid*) &comidaVerts[0]);
glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,
                        (const GLvoid*) &comidaNormals[0]);
glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
                        (const GLvoid*) &comidaTexCoords[0]);

but ndk-build compile doesn't work,,
so I change like this

glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0, comidaVerts);
glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0, comidaNormals);
glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0, comidaTexCoords);

ndk-build success,,
but when i tracking image,,
same result, back to about screen and I try again but camera screen change into blank screen

replace 3d model

May 28, 2013 - 11:36pm #6

The code looks correct, bt make sure you have done all the steps as explained here:

https://developer.vuforia.com/forum/faq/android-how-do-i-replace-teapot

Another reason could be that your comidaNumVerts is too large (too many vertices, so the app crashes)...

 

replace 3d model

May 28, 2013 - 11:53pm #5

oke,, I try u'r link..

comidaNumVerts = 732 - is it large ?

replace 3d model

May 29, 2013 - 12:09am #4

No, 732 is not large.

replace 3d model

May 29, 2013 - 6:06am #3

now object already exists, but very small
how can I make it look bigger ?

replace 3d model

May 29, 2013 - 6:17am #2

If you look at ImageTargets.cpp, you can find a variable called kObjectScale.

This is initialized to 3.0 in the sample, you can increase that.

replace 3d model

May 30, 2013 - 1:38am #1

now my problem with texture..

my object already looks large, but using texture teapot..

how can I make texture like TextureTeapot.png or textureBanana.png with my 3Dmodel ?
how to include the texture in object ?

AttachmentSize
Image icon comidaInAR.jpg156.29 KB
Image icon comida.jpg58.51 KB
Log in or register to post comments