Skip to content

Instantly share code, notes, and snippets.

@pmark
Created May 31, 2011 22:40
Show Gist options
  • Save pmark/1001434 to your computer and use it in GitHub Desktop.
Save pmark/1001434 to your computer and use it in GitHub Desktop.
How to create a 3DAR POI with a 3D mesh OBJ view (requires v0.9.6+)
- (void) add3dObjectNortheastOfUserLocation
{
SM3DARTexturedGeometryView *modelView = [[[SM3DARTexturedGeometryView alloc] initWithOBJ:@"star.obj" textureNamed:nil] autorelease];
CLLocationDegrees latitude = mapView.sm3dar.userLocation.coordinate.latitude + 0.0001;
CLLocationDegrees longitude = mapView.sm3dar.userLocation.coordinate.longitude + 0.0001;
// Add a point with a 3D view to the 3DAR scene.
SM3DARPoint *poi = [[mapView.sm3dar addPointAtLatitude:latitude
longitude:longitude
altitude:0
title:nil
view:modelView] autorelease];
// (OPTIONAL) Add a map annotation for this point.
[mapView addAnnotation:(SM3DARPointOfInterest*)poi];
}
@hitlad
Copy link

hitlad commented Jan 21, 2012

Hi, pmark. Just saw that v2.2 came out. I tried it out and it's working - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment