Is this all code related to the Wikitude SDK api? If so, you're missing the [architectView callJavaScript:@"*jsonString*"]
call. This call will load the places, defined in an json string, to be loaded in AR. Have a closer look at the SimpleARBrowser sample. It demonstrates all necessary steps to load your places in AR.
Augmented reality with wikitude sdk
-
01-04-2022 - |
Pregunta
I am developing an augmented reality app using wikitude sdk. I am quiet new with this sdk. I have implemented everything as per the sdk documentation guidelines. But I can't able to plot the POI points in the AR-Browser view. For generating the POI points I used the following codes.
- (NSMutableArray *)generatePois:(NSUInteger)numberOfPois
{
NSLog(@"%s",__PRETTY_FUNCTION__);
NSMutableArray *poiArray = [NSMutableArray arrayWithCapacity:numberOfPois];
for (NSUInteger i = 0; i < numberOfPois; ++i) {
objGlobalDatas=[arrayItems objectAtIndex:i];
WTPoi *poi = [[WTPoi alloc] init];
NSString *strId=objGlobalDatas.arId;
NSInteger poiId=[strId integerValue];
poi.id = poiId;
poi.name = objGlobalDatas.name;
NSLog(@"poi name =%@",objGlobalDatas.name);
poi.detailedDescription = objGlobalDatas.poi_description;
// poi.type = i%3; // set the type from 0->2->0->2...
poi.type=1;
NSString *strLat=objGlobalDatas.latitude;
NSString *strLng=objGlobalDatas.longitude;
float lan=[strLat doubleValue];
float lng=[strLng doubleValue];
poi.latitude = lan ;//+ WT_RANDOM(-0.01, 0.01); // set the latitude around your current location
poi.longitude = lng;// + WT_RANDOM(-0.01, 0.01);
poi.altitude = YOUR_CURRENT_ALTITUDE + WT_RANDOM(0, 200); // altitude offset
poi.poiimg=objGlobalDatas.poi_indicator_image;
poi.weburl=objGlobalDatas.website;
poi.distance=objGlobalDatas.distance;
[poiArray addObject:poi];
[poi release];
}
NSLog(@"check =%@",poiArray);
return poiArray;
}
I called this function after fetching the data of POI points by parsing a JSON link. In the poiArray I am getting three objects around my current latitude and longitude.But not showing in the AR-Browser view.
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow