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 Nov 17, 2011

I'm getting an error (Can't find dlopen function) on the SM3DARTexturedGeometryView initialization line when I added this code to the YOrient project. Is there something I'm missing? Thanks!

@pmark
Copy link
Author

pmark commented Dec 2, 2011

Hi hitlad. Did you get your question answered? 3DAR v2.1.3 crashes when loading an OBJ file. We've fixed the bug for v2.2 but it's not released yet.

@hitlad
Copy link

hitlad commented Dec 4, 2011

Hi, pmark. No, I didn't get any answers to my question. Any idea when v2.2 may be released? I've started to look at other systems but would like to stick with 3DAR if v2.2 is coming soon. Thanks!

@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