welcome to linkAR technical documentation

next previous

Quick Start

2.1.- Setting up the Development Environment


If you are new to iOS developing the following steps will guide you through the very basics of getting started with apple mobile development.
If you already are an iOS developer and have the development environment set up skip to Create new project. Read more on Apple's developer site:

https://developer.apple.com/devcenter/ios/index.action

2.1.1.- Become an iOS Developer


3D Engine applications can not run in the simulator, must be deployed on iOS devices.
You must enroll to the iOS Developer program to deploy applications on iOS devices.
You can enroll here:

http://developer.apple.com/programs/ios

2.1.2.- Install Xcode and the iOS SDK


Once you have enrolled in the iOS Developer program, you should have access to the iOS Dev Center.

http://developer.apple.com/devcenter/ios

Go to the Dev Center and download Xcode.

http://developer.apple.com/xcode/index.php

2.1.3.- Set up a Provisioning Profile


  1. Sign into the iOS Dev Center: http://developer.apple.com/membercenter/
  2. Go to the iOS Provisioning Portal
    1. Follow the process to obtain a certificate, assign a device, create an App ID and create a provisioning profile. Use the wildcard character (*) to build and install multiple applications with a single ID.
    2. Download the provisioning profile you have just created and install it on your computer (double click on it).

2.2.- Installing 3D Render Engine Framework and creating a Hello World

2.2.1.- Create new project


Select Create New Xcode Project from the splash screen (seen below) or file→new→project.. from the menu.


2.2.2.- Choose Single View Application template


It will give us a basic app template, with a single UIView we can add the EAGLView to.


2.2.3.- Fill project details


Make sure use Automatic Reference Counting is selected. Automatic Reference Counting is not mandatory but it makes memory management easier.


2.3.- SDK Files


  • 3D Render Engine advanced
    • libs/
      • 3dEngine.framework
      • EADUtilities.framework
  • samples/
    • Hello3dLite

2.4.- Create and configure the project

2.4.1.- Add the following frameworks


Click on the project icon in the project navigator view, and under Build Phases tab, add each framework by clicking on the + button in the Link Binary With Libraries forum.

  • AVFoundation.framework
  • Foundation.framework
  • UIKit.framework
  • CoreMotion.framework
  • CoreGraphics.framework
  • CoreMedia.framework
  • CoreVideo.framework
  • OpenGLES.framework
  • QuartzCore.framework


2.4.2.- Add the CVSDK (matcher) framework


  • Add the 3dEngine framework and EADUtilities (as explained above) from the SDK
  • libs/
    • 3dEngine.framework
    • EADUtilities.framework

Here is how your frameworks folder should look like after you finish:


  • On the top of ViewController.h Include the header file EAGLView.h and a class member of type EAGLView:
#import <UIKit/UIKit.h>
#import <3dEngine/EAGLView.h>
 
@interface ViewController : UIViewController<renderProtocol>{   
    EAGLView*			glView;
}
 
@end
  • In ViewController.m alloc and init EAGLView in the viewDidLoad method and Set the App Key you received from the registration service in the website.
- (void)viewDidLoad
{
    [super viewDidLoad];
 
   // Create our OpenGL view.
    glView = [[EAGLView alloc] initWithFrame:self.view.bounds withAppKey:@"--Your API KEY--" withCamera:FPS];
    glView.pMainViewController = self;
    glView.backgroundColor = [UIColor colorWithRed:0.5f green:1.0f blue:1.0f alpha:0.0f];
 
    // Add it as a subView to the View Controller's view.
    [self.view addSubview: glView];
 
    // Bring OpenGL view to front.
    [self.view bringSubviewToFront: glView];
 
    // Register delegate, this is optional.
    [glView setRenderDelegate:self];
 
    // Start rendering.
    [glView start];
}
  • If you set the render delegate, you must add this method
-(void)frameRendered
{
  // TODO
}
  • Configure ViewController.m as a file of type: Objective C++ Source.
  • Set Portrait Orientation.


2.4.3.- Add data


  • Search data folder under the Hello3DLite project and add it into your project with the Folders option: Create folder references for any added folders and with Destination option deselected.

2.5.- How to Run


  • Connect a supported device (see 1.1)
  • Select the device from the target menu
  • Click on the Run button or cmd + r.

2.6.- How to Debug


  • After running, make a breakpoint at the wanted line to stop the debugger on runtime.
  • To make a breakpoint, click on the left margine of the line and a blue arrow will appear indicating a new breakpoint was made.
  • Click on the debug navigation or cmd+5, to browse a list of the breakpoints.

2.7.- How to upload to the AppStore