Imagination PowerVR SDK Blog

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


#1

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.


#2

you mean doing some augmented reality stuff ?


#3

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.


#4

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


#5

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.


#6

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


#7

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


#8

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



and most important

the doc

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


#9

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


#10

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


#11

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()


#12

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