How to start and stop drawing the texture etc upon some event in android application?

I am trying to draw a 3d model when my application detects an image that is scanned with the camera. I cannot figure out how to draw the 3d model on top of the camera view.

you mean doing some augmented reality stuff ?

Yes. I want the 3d model to be drawn only when a certain image is detected. I have the image detection part working. But I cant figure out how to draw the 3d model on the image.

because the Ndk is hardware specific , you cannot access it throught jni easily , so you need to use java ,there is a lot of sample in the Android sdk first of all and here



http://blog.tomgibara.com/post/173247788/java-image-processing-code

http://nhenze.net/?p=253



for IOs

http://chimera.labs.oreilly.com/books/1234000001814/ch05.html#ch05_id36001796



there is thousand of samples out there and approach.



regards

david

I have the image detection part working. It detects the image i train. Now i want to start drawing 3d models on that image using the powervr sdk. the problem is that the powervr sdk uses nativeActivity approach and will always be initialised when the applicaiton starts and not when my image is detected.

sure the sdk provide gles samples ,you can develop an observer and bind it using JNI to inform your native part or java part , the ShellOSImpl part need to be a bit customized but i am sure it will be not a prob for you.

The Jni is the not fun part but there is a lot of samples on the web or book about ndk and java intercommunication

I cannot seem to find any ShellOSImpl.cpp i can only find the PVRShellImpl.h in the shell directory

PowerVR/GraphicsSDK/SDK_3.2/Shell/OS/Android



and most important

the doc

PowerVR/GraphicsSDK/SDK_3.2/Shell/Documentation/html/index.html

is there any specific function i can call from my own native class to start the rendering of the 3d model with powervr?

i would recommend to read the shell documentation and the lifecycle if the application about the rendering

Can you tell me where the android_main() function is present. android_app_glue will be calling the android_main() to start running the native code. I cannot find any implementation of android_main()

Hi,



The android_main() function can be found in the OS dependant part of PVRShell. That is the file /path/to/SDK/Shell/OS/Android/PVRShellOS.cpp.



Cheers,

Guillem