Getting Started Troubleshooting Tutorials Changelog

Getting Started

In most cases, the best approach to adding 3DAR is to first make map annotations appear on an MKMapView, then switch the MKMapView to SM3DARMapView which is a subclass of MKMapView (see Apple's documentation).

The next step is to implement sm3darLoadPoints: which gets called automatically when 3DAR is ready for data loading. Make sure that you do not add annotations to the map before this is called.

Setup

  1. Copy the 3DAR folder from the downloaded .zip in to your Xcode project.
  2. Add the following system frameworks:
    • CoreGraphics
    • CoreLocation
    • CoreMotion
    • Foundation
    • MapKit
    • OpenGLES
    • QuartzCore
    • UIKit
  3. Add -lstdc++ and -ObjC to the target's Other Linker Flags build setting.
  4. Add device and application keys to SM3DAR_keys.txt one per line.

Switch MKMapView to SM3DARMapView

  1. Open the file where the MKMapView is defined.
  2. Import the 3DAR header file.
    #import "SM3DAR.h"
    
  3. Switch all MKMapView references to SM3DARMapView
  4. If the map view is in a .xib file, use Interface Builder to change its Class Identity to SM3DARMapView by selecting the inspector's identity tab while the Map View is selected.

Load Data

Load map annotations in sm3darLoadPoints: which gets called when 3DAR is done initializing.

There are other SM3DARDelegate methods that may be useful to implement as well.

The app's map annotations should now be visible in augmented reality.


Customize

Here are a few ways you can customize the AR experience.

Within 3dar.plist

  • 3darDrawGroundPlaneGrid - Toggle ground plane grid on or off.
  • 3darMapMode -
    • Auto - When phone faces down it automatically switches to overhead map view.
    • Manual - User is responsible for showing and hiding map view.
  • 3darDisableLocationServices - Toggle to disable location updates

Outside 3dar.plist

  • 3dar_marker_icon1.png & 3dar_marker_icon1_focused.png - Can be replaced with custom markers, suggested size of 50X50.
  • 3dar_pano_bg.png - 3DAR can accept panoramic backgrounds. Background image dimensions must be powers of two. Equirectangular work great, but cube mapping is currently not supported.