Skip to content

Expanding on it (v3.0)

Geoffroy edited this page Oct 11, 2013 · 2 revisions

NOTE: This wiki is for v3.0 of the framework and above!

The following tips should help you if you are considering using this framework for your own app (:

Different overlay look & style

If all you want is to change the look of the AR Overlays, just change things around in the xib file for ARObject.
You may need to modify a few things for the overlays to work as you want to:

  • ARController.m line 78 The x-axis position is calculated and aligns the right tip of the overlay with the location. You might have to modify this too for the same reasons described above.
  • ARController.m line 133 Half of the height of the overlay is subtracted to the y-axis position, to align the tip of the overlay with the location. If you're new overlay doesn't have a "tip" or has it somewhere else on the overlay you might need to modify this.
  • ARController.m line 122 the overlay is "warped" (top is squished and the rest aligned to this new width) for 3D Perspective effect. If you'r overlay shape is wider or taller you might want to modify this a little if you want a more dramatic or more subtle effect. To do that, just play around with -0.0004 multiplying the vertical position).

Different/more data

For example, if you want to also show the address of a place on the overlay, you will need to:

  • Modify the overlay look (check out the notes above)
  • Add an address variable (like an NSString) to the ARObject class
  • Add the address as an argument of the -(id)initWithId:(int)newNid ... function of that same class ** During the initialization of the ARObject, under the -(id)initWithId:(int)newNid ... function, initialise the address variable with the passed address argument.
  • Add the address variable to the values array in the - (NSDictionary*)getARObjectData function in ARObject.m line 72
  • Update the creation of ARObjects in ARController.m line 108 to reflect the new function
  • Add an address variable in the data in each dictionary for the ar objects

The same goes for any other kind of data you'd like to change...

Different positioning

If you want to position the overlays differently, right on top of the building they are representing, or on top of each other (not vertically stacked based on distance) there are several places you will need, other than the ones described above:

  • ARController.m line 141 the vertical position (on y-axis) is set based on distance. You may want to ignore this entirely and thus comment out the block of functions lines 131-133 (they all relate to the same thing), but note that you might have weird results with all overlays overlapping each other (: