Topic locked

Replace 3D model with different 3D model

June 27, 2013 - 6:07am #17

Dear Al,

Now all of object disapear...(teapot and banana)

i try re-import the project

rebuild with ndk-build

refresh

still nothing show..

please help me..

thanks

Replace 3D model with different 3D model

June 27, 2013 - 6:47am #16

Is there a reason why you are using OpenGL ES 1.0 ?

You should always use OpenGL ES 2.0, unless your are targeting very old devices that might not support 2.0.

 

Replace 3D model with different 3D model

June 27, 2013 - 5:47pm #15

hi AL, actually there is no reason why i use OPENGL 1, just for try and error.

and now i figure out the problem is, my object won't appear if far from the light

and when i try to light place the object appear clearly, could you give a reason why ?

 

thanks

regards

Replace 3D model with different 3D model

June 27, 2013 - 11:56pm #14

my object won't appear if far from the light

which light ? there is no light in the official sample code.

 

Replace 3D model with different 3D model

June 28, 2013 - 1:25am #13

hi Al, what i mean with "far from light" is lack of light / dark light

so when i stand in the dark light posistion, the object won't appear.

and could you please tell me the different and function of this two script

glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &bananaVerts[0]);
        glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &bananaNormals[0]);
        glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &bananaTexCoords[0]);

and

glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &TeapotVertices[0]);
        glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &TeapotNormals[0]);
        glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &TeapotTexCoords[0]);

thanks

Replace 3D model with different 3D model

June 28, 2013 - 1:34am #12

Hi,

so, if you are referring to the lighting condition of your environment (e.g. the room where you are doing your tests),

then this is expected; if the camera of your device gets a too dark image because the light is insufficient, it will be more difficult for Vuforia to detect the target.

Concerning the OpenGL code below, the only difference is that the first will render the teapot mesh, and the second will render the banana mesh.

 

Replace 3D model with different 3D model

June 28, 2013 - 2:11am #11

AlessandroB wrote:

Concerning the OpenGL code below, the only difference is that the first will render the teapot mesh, and the second will render the banana mesh.

ok i got that point, but the big different which i saw is in part "bananaVerts" and "TeapotVertices" is there any different function between verts and vertices ?

thanks,

Replace 3D model with different 3D model

June 28, 2013 - 2:41am #10

ok i got that point, but the big different which i saw is in part "bananaVerts" and "TeapotVertices" is there any different function between verts and vertices ?

Those are just variable names (not functions), and they are defined in their respective header files (see teapot.h and banana.h); actually you can rename them if you like.

Note: understanding the difference between functions and variable names is the basic of C/C++ programming, maybe not appropriate to post these questions in the Vuforia forum...

 

 

Replace 3D model with different 3D model

July 8, 2013 - 9:00pm #9

Dear  Al,

When i try to convert 3D objek (obj) to .h file it's look fine, and i tried for once.

and now i'm trying to replace with another objek (ex: book.obj) i convert to .h file with opengl,

i put it into imagetarget.cpp

#include "book.h"

 

i replace glVertextAttribPointer Code :

glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
                                      (const GLvoid*) &bookVerts[0]);

and then glDrawElements

glDrawElements(GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT,
                               (const GLvoid*) &bookNumVerts[0]);

so i got this error message :
 

C:\Development\Android\vuforia-sdk-android-2-5-7\samples\sampleImage>ndk-build
"Compile++ arm  : ImageTargets <= ImageTargets.cpp
jni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTarge
ts_ImageTargetsRenderer_renderFrame(JNIEnv*, jobject)':
jni/ImageTargets.cpp:441:65: error: invalid types 'unsigned int[int]' for array
subscript
make: *** [obj/local/armeabi/objs/ImageTargets/ImageTargets.o] Error 1

could youe please help me

 

 

thanks, regards

Replace 3D model with different 3D model

September 29, 2013 - 5:19am #8

Thank you so much !!!  that what i was looking for :D

Replace 3D model with different 3D model

May 13, 2014 - 8:16am #7

thank you very much for advising, but I want to know  where to put 

// set input data to arrays
glVertexPointer(3, GL_FLOAT, 0, bananaVerts);
glNormalPointer(GL_FLOAT, 0, bananaNormals);
glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords);
 
in  ImageTargets.cpp 
 
?? please anwser for me :)

Replace 3D model with different 3D model

May 20, 2014 - 4:46pm #6

I already solved it :)

Replace 3D model with different 3D model

May 21, 2014 - 3:34am #5

fatanku try this one,

 

glDrawArrays(GL_TRIANGLES, 0, bookNumVerts);

:)

 

 

Replace 3D model with different 3D model

May 21, 2014 - 3:37am #4

dear AlessandroB,

 

I want to thank you help us too much, and now I am worndering about  what is the differenct between 

 

gl_FragColor = texture2D(texSampler2D, texCoord);\

 

and 

gl_FragColor = vec4(shadedColor, 1.0); \

 

gl_FragColor = texture2D(texSampler2D, texCoord);\    this will load my textture,but not good quality 

 

gl_FragColor = vec4(shadedColor, 1.0); \  the texture will be white( I know this will not load the texture)

 maybe my texture mess up ? or ?

 

so how should I do to make my texture more delicated and colorful

 

and please take a look at my model  

 

 

AttachmentSize
Image icon testure.jpg95.7 KB
Image icon no testure.jpg101.74 KB

Replace 3D model with different 3D model

May 21, 2014 - 4:12am #3

@linguanting,

gl_FragColor = texture2D(texSampler2D, texCoord);

this will assign the texture color to your mesh 

while

gl_FragColor = vec4(shadedColor, 1.0); 

this will assgign whatever "shadedColor" color to your mesh.

To make it look nicer, there are various things to consider, e.g. you could combine a shadedColor with your texture color by multiplying the 2, for example:

vec4 textureColor = texture2D(texSampler2D, texCoord);

gl_FragColor = vec4(shadedColor.rgb * textureColor.rgb, 1.0);

 

But there are a trillion possible things you can do in a shader.

I would suggest to have a look at some good OpenGL shader tutorials online, to see what you can do with OpenGL and GLSL shader code, as this is really not in the scope of Vuforia.

 

 

Replace 3D model with different 3D model

May 21, 2014 - 5:45am #2

you saved my life again ! 

 

this looks more better, I think I have to  revise some texture detailed, and thank you again 

Replace 3D model with different 3D model

May 22, 2014 - 3:17am #1

A lot nicer indeed !

 

Pages

Topic locked