SDK Documentation

Community support forum for the ARToolKit Professional v4.x for iOS SDK.

Moderator: ARToolKit developers

Forum rules
Ensure that any material you post to this forum complies with Apple's iOS SDK License terms.

SDK Documentation

Postby stanislav » Wed Feb 09, 2011 3:15 am

I have ARToolKit4iOS-release1.0-2010-09-06 that I downloaded from your site.
There is the folder named "doc" in this package, but html documents have empty description for classes, methods.

Do you have complete documentation?

For example there is a fragment of code in ARApp sample:

// libARvideo on iPhone uses an underlying class called CameraVideo. Here, we
// access the instance of this class to get/set some special types of information.
id cameraVideo = ar2VideoGetCameraVideoInstanceiPhone(gVid->device.iPhone);
if (!cameraVideo) {
NSLog(@"Error: Unable to set up AR camera: missing CameraVideo instance.\n");
[self stop];
return;
}

// Under iOS 4.0 the camera will be started by -startRunLoop.
[cameraVideo performSelector:@selector(setTookPictureDelegate:) withObject:self];
[cameraVideo performSelector:@selector(setTookPictureDelegateUserData:) withObject:[cameraVideo performSelector:@selector(bufDataPtr)]];

"ar2VideoGetCameraVideoInstanceiPhone" function is not described in SDK documentation.
For example the description is needed to understand where in code the delegate methods are being run.
stanislav
 
Posts: 3
Joined: Wed Feb 09, 2011 2:56 am

Re: SDK Documentation

Postby philip_lamb » Wed Feb 09, 2011 4:48 am

Yes, you have quite correctly observed that not every function in the ARToolKit API is documented. Many functions are used only internally to ARToolKit itself, and knowledge of these functions is not necessary to use ARToolKit.

CameraVideo is not documented, but it is also not necessary to have it documented, since it is an internal implementation detail. The methods which you list simply request that the CameraVideo instance underlying libARVideo calls ARViewController as each frame is fetched. The method called is:
Code: Select all
- (void) cameraVideoTookPicture:(id)sender userData:(void *)data
User avatar
philip_lamb
Site Admin
 
Posts: 506
Joined: Thu Mar 09, 2006 8:35 pm

Re: SDK Documentation

Postby stanislav » Thu Feb 10, 2011 7:16 am

Philip, thanks for your answer.
The previous question is solved.

In the SDK sample (ARApp) the cube is overlaid to the captured frame.
Moreover the cube is located on a marker face by computing (method "arGetTransMatSquare") and applying transformations.
In this sample it is used OpenGL to draw some overlaid object (cube).

Instead cube I have some HTML document (view based on UIWebView).
In this case, how can I compute and apply transformations that HTML document face is located on marker face?
Maybe is there some code example?
stanislav
 
Posts: 3
Joined: Wed Feb 09, 2011 2:56 am

Re: SDK Documentation

Postby stanislav » Thu Feb 10, 2011 11:52 pm

This is advanced information to the previous post.

To draw HTML document I use subview (the instance of UIWebView) of the view that play captured video.
As I know, to overlay marker I need set some parameters to subview (at least, subview.frame and subview.layout.transform.rotation), but i don't know how I can get (calculate) values to this parameters having ARToolKit gARHandle->markerInfo[some index] ?
stanislav
 
Posts: 3
Joined: Wed Feb 09, 2011 2:56 am

Re: SDK Documentation

Postby philip_lamb » Fri Feb 11, 2011 1:32 am

Drawing non-OpenGL content into the 3D view (i.e. the virtual environment) is not supported, but might be possible with some work.

My recommendation would be to not try to use CoreAnimation transforms to position UIView-based content (e.g. your UIWebView) in 3D space. Rather, I would render the CALayer underlying the UIWebView into a CGImageContext, and then use that CGImageContext's data to create a texture, and then render that texture into the scene. This is all outside the support we could provide though. I would recommend asking on the iOS Developer Forums about getting the contents of UIWebView as an OpenGL texture.

As for arGetTransMat().. this returns a homogenous coordinate transform, as a 3x4 matrix (with an implicit fourth row of [0, 0, 0, 1]). You can convert this to a standard OpenGL column-major 4x4 matrix by calling arglCameraView().
User avatar
philip_lamb
Site Admin
 
Posts: 506
Joined: Thu Mar 09, 2006 8:35 pm


Return to ARToolKit for iOS

Who is online

Users browsing this forum: No registered users and 0 guests

cron