Log in or register to post comments

Change the displaying 3D object dynamically at runtime.

July 31, 2012 - 1:44pm #1

Hi

I have managed to change the teapot 3d object to a 3D object of my choice but I was wondering if there is a way to change the 3D object displayed dynamically the same way we can change the dataset at runtime.

For example when my application recognizes the "stones" trackable it renders the teapot but with a press of a button in the menu the teapot changes into a banana 3D object. 

Thanks

Change the displaying 3D object dynamically at runtime.

August 17, 2012 - 2:20am #14

Thanks for your reply
but these threads are not really what I need right now ^^;
I already worked through them a week ago and I already have my own trackables and my own 3d modell (all working fine)
But I want to change the 3d modell dynamically at runtime just like chriseco :)
so I would be very grateful to see his solution

-best regards

Change the displaying 3D object dynamically at runtime.

August 15, 2012 - 1:00pm #13

David is right. Instructions on following two places helped me to solve the problem. 

https://ar.qualcomm.at/content/replace-3d-model-different-3d-model

https://ar.qualcomm.at/content/createreplace-object

Change the displaying 3D object dynamically at runtime.

August 14, 2012 - 8:28am #12

There are instructions for rendering your own model in this thread - https://ar.qualcomm.at/content/replace-3d-model-different-3d-model

Also see - https://ar.qualcomm.at/content/createreplace-object

Change the displaying 3D object dynamically at runtime.

August 14, 2012 - 3:25am #11

Could you please post your method? You would help me alot since I'm having the same problem.
Would be very nice^^

-best regards

Change the displaying 3D object dynamically at runtime.

August 14, 2012 - 3:25am #10

Could you please post your method? You would help me alot since I'm having the same problem.
Would be very nice^^

-best regards

Change the displaying 3D object dynamically at runtime.

August 8, 2012 - 2:46pm #9

Also be sure to use glDrawArrays(GL_TRIANGLES, 0, numVertices) rather than glDrawElements being that your model doesn't have indices.

Change the displaying 3D object dynamically at runtime.

August 6, 2012 - 6:45pm #8

Yes, I have been using the vuforia samples on the device that I am using.

I  also did check and my texture is loading in my application. It is only when the marker 1 is focused the application crashes with error

"08-06 18:29:06.980: A/libc(6300): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 6429 (Thread-6118)"

 

I have made following changes to framemarkers.cpp

added  :  #include "myModelHeader.h"

 

Replaced existing case 1 with myModel data as below :

 case 1:

            vertices = &myModelVerts[0];

            normals = &myModelNormals[0];

            indices = 0;

            texCoords = &myModelTexCoords[0];

            numIndices = myModelNumVerts;

            break;

 

 

Change the displaying 3D object dynamically at runtime.

August 6, 2012 - 11:20am #7

Can you post the modifications that you'd made to your C++ file? - I don't need the whole file, just the revised sections.

Also have you been able to run the Vuforia samples on the device that you're using?

Change the displaying 3D object dynamically at runtime.

August 6, 2012 - 11:16am #6

Thank you for your reply.

I tried to follow your instructions and was successfully able to generate .so file.

But, When I try to run the code on device the program exists when camera previews the marker with the following logs

 

Logs : 

 

08-06 10:58:25.836: D/QCAR(27834): Configure Video Background : Video (640,480), Screen (800,480), mSize (800,600)

08-06 10:58:25.863: D/dalvikvm(27834): WAIT_FOR_CONCURRENT_GC blocked 0ms

08-06 10:58:25.886: D/dalvikvm(27834): GC_EXPLICIT freed 82K, 10% free 13357K/14791K, paused 2ms+3ms, total 25ms

08-06 10:58:26.797: D/QCAR(27834): Java_com_qualcomm_QCARSamples_FrameMarkers_FrameMarkers_setProjectionMatrix

08-06 10:58:26.800: I/Choreographer(27834): Skipped 61 frames!  The application may be doing too much work on its main thread.

08-06 10:58:26.820: D/libEGL(27834): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so

08-06 10:58:26.840: D/libEGL(27834): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so

08-06 10:58:26.847: D/libEGL(27834): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so

08-06 10:58:26.879: I/QCAR(27834): Creating OpenGL ES 2.0 context

08-06 10:58:26.898: D/QCAR(27834): GLRenderer::onSurfaceCreated

08-06 10:58:26.898: D/QCAR(27834): Java_com_qualcomm_QCARSamples_FrameMarkers_FrameMarkersRenderer_initRendering

08-06 10:58:26.906: D/QCAR(27834): GLRenderer::onSurfaceChanged

08-06 10:58:26.906: D/QCAR(27834): Java_com_qualcomm_QCARSamples_FrameMarkers_FrameMarkersRenderer_updateRendering

08-06 10:58:26.906: D/QCAR(27834): Configure Video Background : Video (640,480), Screen (800,480), mSize (800,600)

08-06 10:59:29.496: E/AR(27834): Failed to set focus mode

08-06 10:59:29.496: I/QCAR(27834): Requested Focus mode Continuous Autofocus.  Not supported on this device.

08-06 10:59:43.570: A/libc(27834): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 27850 (Thread-4668)

 
Can someone please help with this.

Change the displaying 3D object dynamically at runtime.

August 3, 2012 - 7:05pm #5

You're working from the FrameMarker's sample?

Within the renderFrame method @ line 138 there is a section starting at 185 that shows how to assign the model arrays from the header file according to the ID of the FrameMarker that has been detected. You'll need to add the arrays from your header file to the array variables by name. Ignore the numbers in your header file and just copy the names of the arrays that they belong to.

You can use the other instructions for ImageTargets to draw your models.

Change the displaying 3D object dynamically at runtime.

August 3, 2012 - 1:44pm #4

How should I reassign the arrays and indices counts used for rendering models. I am able to generate .h files from .obj using the perl script. When the .h file gets generated it is 80% full of numbers.

Where should I make changes to replace existing Q, C, A, R with my current model

Thanks

Change the displaying 3D object dynamically at runtime.

August 2, 2012 - 4:38am #3

Thanks for the reply but I figured out the solution . That was what I actually did .

I created a new method in the ImageTargets.cpp that got as parameters the arrays and indices for rendering the model and called this method with different parameters whenever I wanted to draw a new 3D object.

 

Change the displaying 3D object dynamically at runtime.

August 1, 2012 - 8:16pm #2

You should be able to do this by reassigning the arrays and indices counts used for rendering these models. Are you familiar with how to load models using header files?

Log in or register to post comments