"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Swap OpenGL for image

On the iOS SDK, whats the best method of swapping out the OpenGL rendering stuff and instead just show an image, a PNG or JPG that is available in the apps resources folder which can be displayed over the top of the trigger image? I've read the example for the Youtube video overlay, but that was for Android / Java environment, just wanted to see possible options for iOS Thanks Jason

jasonkerner

Wed, 02/15/2012 - 19:28

Thanks for the reply, could you post your code snippet for how you did your UIViews? I've got the code working from that video examples to get the corners, just wanted to see how your implementation was with relation to the CGPoints returned Thanks for your help - appreciate it Jason

Hi Jason, The posts #18, #21 in the thread provided, made by Kim, show how to set up a view - in this case for a video view. From renderFrameQCAR you'd call a method on the main thread (as renderFrameQCAR is running in a thread that can't access the UI), that sets the view's frame CGRect according

jasonkerner

Tue, 02/21/2012 - 21:33

Really appreciate the help so far and been trying to mod the ImageTargets demo app to try and replace the target with a view (a basic red background one for the time being) - tried to execute the UI call on the main thread and it killed my phone and it rebooted.

Ah, you need to do all the UI stuff on the main thread, so move everything out to updateUI that creates or refers to UIView. You can use private class properties (or static variables!) to hold the information you want to communicate between calc... and update... (eg. myFrame).

jasonkerner

Wed, 02/22/2012 - 21:42

Hi MoSR, Moved everything to the other method, and set some class ivars, but the iPhone still crashes - if I put NSLog statements in, it runs those in the log, but doesn't load my red square view over the top - I've popped the project code up here, its basically the ImageTargets sample code, and I'

Hi Jason, I see some problems here: 1) it's a good idea to create the view as a sibling of the EAGLView not a child. Create it in the appDelegate and add it to the window after the EAGLView but before the overlay view. Either hide it or move it off screen for the pre-detection phase.