ARtoolkit fun

Hi everyone,

while i was bored again i thought i might aswell do something “usefull”. so here it is:

source with all nececssary files included can be found here.
i only tested it on linux. dunno if you need to change stuff for windows but if someone has windows and can test it and get it to work feel free to post the code-changes.

With approximately 0.6 seconds i could come up with more than 10 very cool or useful things you could do with this. Unfortunately its not in my intrests list, but i know it will make many people very happy to see an open source solution for it.

Just wanted to say.

hah cute! thanks for sharing it

I played with artoolkit as well, but this was a nice idea, well done.

p.s. buy a printer :wink:

ThomasEgi, love your posts.
I’m new to the whole artoolkit and want to know how you would, if you could, replace the camera image with the window from your developed game (say for motion capture within a fictional environment).

That’s easy by just passing a rendered texture to ARToolKit instead of a camera image. But it makes no sense whatsoever ot do that. The whole point of this is to acquire 3D coordinates of a pattern in the real-world - in the virtual world, you’ll already have those coordinates.

hi. i m new to panda.
i precisely wonder how to get the rendered texture out of panda (the whole main window of panda3d in an opengl format) in order to pass it to another opengl application (like an opengl pygame window for ex). What s the command for that ?

That involves rendering the content of the main window to a buffer (setting “window-type” to “offscreen” helps), and then getting the RAM image data via (or the slower getRamImageAs() for format conversion).

Ok. Thanks for answering.
I ve tried .getTexture().getRamImage() yesterday but at the end i couldn’t run both pygame and panda3d at the same time in the same program, since panda3d has to run in the main thread apparently (under python). Any idea ?

Running Panda in a child thread is possible, but you’d probably have to compile Panda yourself to support true threading. But you don’t need to do this; you can run Panda in the main thread, and coexist happily with pygame–just call taskMgr.step() from time to time instead of calling

Still, it seems like a weird thing you’re doing, to have two different OpenGL contexts running in the same process. I doubt you’ll get very good performance that way (your graphics card will have to switch back and forth between the two different contexts). Whatever problem you’re trying to solve, are you sure that’s the best solution?


Using taskMgr.step() is a great idea. I was wondering how to call panda3d step by step

I know it sounds weird. The thing is i wanna use occasionally 3d within a multitouch context using pymt (a mt framework built on pygame). i m gonna try your suggestion. THXS!