collada and artoolkit

Hi guys,

I’ve been working with the ARToolKit example from parmendil here: and trying to get it to work with collada loaded markers, using the collada loader from theo here: I’m trying to combine the two but with limited OpenGL knowledge, and limited CrtRender examples on the internet, I’m not making much progress. Can anyone offer some insight into how this might work? I’m not sure how to draw the model to the screen so that it looks positioned at the marker location.

This is what my draw() method looks like:

void testApp::draw(){  
	// === COLLADA stuff starts here  
	ofTranslate(0, ofGetHeight(), 0);  
	ofScale(1, -1, 1);  
	// draw the feed from the camera to the screen  
	// === ARToolKitPlus stuff starts here  
         //this is where we use the calculated matrix from ARToolkitPlus to put  
	//in our graphics at the location and orientation of the marker.  
	//- the matrix has the 0,0 point as the center of the marker.   
	int numDetected = tracker->getNumDetectedMarkers();  
	glViewport(0, 0, 1280, 720 );  
	glMatrixMode( GL_PROJECTION );  
	if (numDetected > 0)  
		ARToolKitPlus::ARMarkerInfo marker = tracker->getDetectedMarker(0);  
		float m34[ 3 ][ 4 ];  
		float c[ 2 ] = { 0.0f, 0.0f };  
		float w = 40.0f;  
		tracker->rppGetTransMat( &marker, c, w, m34 );  
		float m[ 16 ];  //this is some crazy matrix transformative stuff.   
						//I think initially it came out of one of the arToolkit functions....   
						//but i got it from here: [](  
		for ( int i = 0; i < 3; i++ ) {  
			for ( int j = 0; j < 4; j++ ) {  
				m[ j * 4 + i ] = m34[ i ][ j ];  
		for ( int j = 0; j < 3; j++ ) {  
			m[ j * 4 + 3 ] = 0.0f;  
		m[ 3 * 4 + 3 ] = 1.0f;  
		glMatrixMode( GL_MODELVIEW );  
		glLoadMatrixf( m );  
		glRotatef(-90, 0, 0, 1);  
	        if(_CrtRender.GetScene()) _CrtRender.Render();   

I’m sure something has to happen around the _CrtRender.Render(); call to affect the geometry of the 3D scene, but I’m not sure what that is. Any help would be great.


Oh, I should mention that this code simply displays the loaded model in the middle of the screen, unaffected by the marker, but the marker does get detected.

Hi Jaypozo

You’re right, there’re some modifications to do in the Collada Redender. I already asked to some guys who have posted that they have already did it but I didn’t get any answer from them about how to do it. :slight_smile:


I’m also searching for a working solution of collada + artoolkit.

I’ve looked at the collada renderer code and I guess the integration is possible with a little bit of hacking the camera class.

There is another question, is it possible to load and render more than 1 collada object (animation). I need to load a different object for the different markers.

Any help will be appreciated! :slight_smile:

If I’ve got any success I’ll bring it back.