videomapping - ofxMapaMok

Hi to all

My name is Natxo Pedreira, i’m a spanish/galician oF developer, i want to show you a work that we make with the collaboration of Patricio Gonzalez Vivo.

Patricio has made an addon version of the great mapping app by kyle mcdonald “mapamok” he has introduced new features like the posibility to use a textured 3d model and more.

We used that in a live event, one nice thing about this work is that we found a nice way of integrate our mapping in the workflow. The projection was controlled by another company who wants to have controll over the contents, they used a commercial soft called Watchout, to take care of the projection contents and other screens that were part of the show.

In resume, we have to capture their video signal and use that to texture the 3dmodel, later our signal is captured and used that as video input source in Watchout. This way they have absolute controll of the projection contents, and the mapping machine is a part of the show.

The addon:

some photos:

Poliestirene surface, the black modules are christie microtails

having a coloured snapshot makes more easy the adjust

nice video effects with moving cubes

1 Like

great work pandereto! …a little video wouldn’t hurt though! :slight_smile:

would you know how to use this with two projectors, which are both connected to the same computer and show the same OF app stage.

you have to use two instances of mapamok and render the same content, also you have to make one calibration for each instance.

Hi, I wanted to check this out on .073 OSX but when I try and run your example I get an arror

sharedlibrary apply-load-rules all
Warning: the current language does not match this frame.
warning: Could not find object file “/openFrameworks/GLUT/OF_CUSTOM_GLUT/libForeground.a(macx_foreground.o)” - no debug information available for “/Users/mcast/Code/GLUT-ToPost/macx_foreground.m”.

I get an exception on this line

return mesh.getVerticesPointer()[bestChoice];

Any clues?


Does the dae has textcoords? The model has to be texturized in sketpchup or something, it has to be exported with the textcoords.

Tell me if that works, if not i will take a look, we used that in osx and 0.71 (i think)

Not sure how to check, it was the model that was included in the example.

Try with this model, it doesnt have the textcoords in place but i tested and loads the model.

Same results- I guess I should try downloading 0.71 and see if it works. It is not urgent for me but I have an OF app that I am feeding to madmapper at the moment. I thought it would be fun to try get that out of the loop and have everything all in one neat package.

Thanks a lot by the way!

i am guessing you have to use the empty example that came with the 073 dispo, copy the src files over and then compile.
don’t just open the xcode file that came with the example.
sometimes when examples are made with an other version of OF they do not run with your current version.


Right now, i dont have time to check, but i will take a look at night.

@stephanschulz That was the first thing I did, I only kept the src and the bin for the data folder.

@pandereto no problem like I said I just wanted to take a look and see if I could use it.

now i managed to create two instances of the addon and create two separate mapping environments.

but i am noticing that anything drawn inside applyMatrix() does not get cropped by the viewprt

	if(calibrationReady) {  
		intrinsics.loadProjectionMatrix(10, 2000);  
        if(getb("setupMode")) {  
			imageMesh = getProjectedMesh(objectMesh);  
	} else{  

since i have two environments side by side i can’t just draw a black rectangle to hide the overlap.

any ideas?

Hi stephan

I dont really understand where your problem is, maybe if you post some code i can help

Two ofxmapamok instances

here is my test project:

i modified ofxMapamok a bit to not rely on ofxsmartview. so it is included in the src folder.

problem #1:
it currently is only showing one viewport. in renderMode you can see that before all 6 points are placed the _texture->draw() (or in my case contentFBO.draw()) overshoots the viewport window. and once all 6 points are set the model overshoots too.

problem #2:
in void ofxMapaMok::render switch case:0 it does not draw/bind the texture to the mesh.
i can draw the texture via _texture->draw(); but binding does not work.

problem #3:
when trying to select on of the default shaders from the control panel i get this error message:
[error] OpenGL generated error 1281 trying to get the compile status for GL_VERTEX_SHADER shader. Does your video card support this?
[error] Program failed to link.
[error] Shader program reports:
ERROR: Input of fragment shader ‘normal’ not written by previous stage
ERROR: Input of fragment shader ‘randomOffset’ not written by previous stage
ERROR: Input of fragment shader ‘position’ not written by previous stage


why you dont use the addon as is¿
you need something that the addon doesnt do?

Also, if i understand what are you trying to do, to proyect a continuous horizontal area, why are you using two instaces? you can not span across the two screens an use only one instance?

i guess i was trying to learn how everything worked and started taking it apart.
is more fun this way :wink:

also i was confused about the canvas stuff and that i could alter it’s size etc.

but maybe i should give it a second try.


That sounds good but maybe if you want to see how it works, its a good idea to check the original mapamok from kyle

you can change the size and the positon of the canvas, draggin and resizing with the ofxSmartViewPort it only extends ofrectangle and have a few method to make it draggable

i took a second look at your addon which uses ofxSmartViewPort and it seems to have the same problem of over shooting the viewport.

here is a short video:

i am using two instances of ofxMapaMok.
the reason for not just using one long one is that i have two projectors connected, both projectors edges are overlapping in the middle of the final projection.
so i have to make a separate matrix for each one.

after trying a few things i think i found a solution/hack.

it revolves all around

intrinsics.loadProjectionMatrix(10, 2000);  

in ofxCv’s Calibration.h i commanded out //glViewport(0, 0, imageSize.width, imageSize.height);
and placed glViewport(myViewport.x,myViewport.y,myViewport.width,myViewport.height);
just on top of the code posted above.

once i have a complete working version i will post it.