ARToolkit for Max/MSP

Mar 3, 2011 at 6:31am

ARToolkit for Max/MSP

New Project on github.

https://github.com/cap10subtext/jit.artkmulti

I’m just totally swallowing my pride on this one and posting this obscene mess of code. Forgive the cliche but I’m NOT a classically trained programmer, it’s been my one of my pet projects for learning C which of course means lots of trial and error and beginners mistakes.

In particular I’m having issue with deleting and creating a new object and changing the camera dims during run time.

One thing that’s missing from this code post (though it should be obvious what’s required), you need a folder called artk.support in the Max5/ folder (can’t be in the cycling 74 folder at the moment, fopen rejects any spaces in the path to camera.dat or multi/objectdata2

objectdata2 is being used with 4 obejcts, currently hard coded for 4 outlets.

The help patch is particularly scary but it’s just an early version I picked out at this late hour so there was something to test with.

I know it’s rough but I’ve heard a lot of interest in this recently. Hopefully someone will find it useful.

Currently the compile is Intel Mac only.

Attachments:
  1. artk.support.zip
#55303
Mar 6, 2011 at 9:47am

Hi !
Am I the only one to get this:

Jitter 1.7.0 installed
jit.artkmulti: unable to load object bundle executable
2011-03-06 10:46:56.953 MaxMSP[4444:20b] Error loading /Applications/Max5/artk.support/jit.artkmulti.mxo/Contents/MacOS/jit.artkmulti: dlopen(/Applications/Max5/artk.support/jit.artkmulti.mxo/Contents/MacOS/jit.artkmulti, 262): no suitable image found.
Did find:
/Applications/Max5/artk.support/jit.artkmulti.mxo/Contents/MacOS/jit.artkmulti: mach-o, but wrong architecture

I’m on 10.5

Anyway, this going to be very nice to artoolkit for MAx ! Just have to make it work :)
Cheers.
Ad

#198999
Mar 6, 2011 at 3:27pm

Will check compiler settings. What type of machine are you on?

#199000
Mar 6, 2011 at 10:18pm

great work!
but I have a strange behavior in my patch. the cube (or whatever it’s rendered) is not erased when loosing the track of the pattern. It’s supposed to be like that? A work around would be to send a not draw (or something similar) message to jit.gl.sketch or jit.gl.model when the pattern is lost, but for doing so some index number (0 or 1) should be sent together with the list with coordinates. Or we could do something else to get the object erased?

#199001
Mar 6, 2011 at 10:24pm

Mac book pro 10.5.8
Xcode 3.1
max 5.1.7

Thank you in advance.
Ad-

#199002
Mar 7, 2011 at 3:15pm

Ad.: I’ve tweaked something in the compiler that may have been causing the problem. Please feel free to try this one.

sandroid: the first element of the list is now 1 or 0 (visible or not) so you can connect your gl object to an enable $1 message to add or remove your model from the scene.

New Downloads are here:

https://github.com/downloads/cap10subtext/jit.artkmulti/ARTookitMax.zip

#199003
Mar 7, 2011 at 6:17pm

Damn, I just typed out this big, detailed post and my browser ate it….
Take 2… (greatly summarized due to frustration of having to retype it all):

Here are the main issues I’m contending with:
1. Including external files: fopen won’t accept (even properly escaped) spaces. Suggestions? Where to keep file, workarounds to fopen?
2. Can you realloc after jit_object_alloc? I’ve checked that the sizeof everything I want to realloc into x:
x = (t_jit_artoolkit *)realloc(x, sizeof(x) + (sizeof(ObjectData_T) * *objnum));
seems to be within the 16384 bytes limit so I’m a little confused (not very savvy with memory management in C).
3. Reinit based on change of incoming dims: obviously Jitter handles this a little differently than ARToolkit. My attempt to do this:
if ((in_minfo.dim[0]!= xsize)||(in_minfo.dim[1]!= ysize)) {
arVideoCapStop();
arVideoClose();
argCleanup();
xsize = in_minfo.dim[0];
ysize = in_minfo.dim[1];
post(“input dimensions changed”);
jit_artkmulti_param_load();
}
Sends ARToolkit into a death spiral. So clearly I’m not re-initializing ARToolkit properly. Perhaps someone familiar with ARToolkit will stumble across this post and point out my silly mistake.

#199004
Mar 7, 2011 at 7:44pm

thanks for the update!
despite the problems you just related, I’s really cool to have artoolkit ported to jitter.
I will use a lot with my students this year.

thank you

#199005
Mar 10, 2011 at 6:17pm

New Project page up (easier download link for those scared of github) ;)

http://www.aranarproductions.com/artk/

#199006
Mar 11, 2011 at 10:37pm

Hello
Apparently you made the exrernal with xcode 4, 10.6 leopard…
that might be the reason it doesn’t work on 10.5.

Cheers.

Ad.

#199007
Mar 12, 2011 at 3:14pm

Ad.: Xcode 3.2.5 actually, with the base system being set to 10.5. I tested an earlier version on my other computer which is 10.5. Will do again and see if I can find the problem. Just been a bit busy lately.

#199008
Mar 12, 2011 at 4:28pm

Okay, I've confirmed it's not a leopard issue, this is running on my leopard machine. Try downloading the new version and getting rid of any existing ones.

[attachment=156281,1915]

Attachments:
  1. Picture2.png
#199009
Mar 13, 2011 at 3:15pm

oups— you’re right… I reinstal max, but nothing change…

Can anyone reproduce the bug ?
Just dont get it…
mac book pro 10.5.8.
Max 5.1.7
Java 1.5
Ad-

#199010
Mar 14, 2011 at 4:24am

Can you replicate what I’ve just done and post a screen shot with object, Max printout, and machine info? Maybe it’ll give me a clue…

#199011
Mar 14, 2011 at 5:54am

Thank you for your concern. Here it is:

[attachment=156404,1925]

Attachments:
  1. screen.png
#199012
Mar 14, 2011 at 3:15pm

Ad. I’ve posted a new download but I’m not sure if it’ll help. Be absolutely sure you’ve trashed all the old versions and then put artk.support at /Max5.

(It’s at the same link)

http://www.aranarproductions.com/artk/

It’s compiled as 32-bit Universal, Base system 10.5, valid architectures x86_64 i386. That should do the trick, and I’ve ensured that the project settings are the same for the executable as they are for the project info.

If that’s not it, we may need help from the c74 crew on this…

#199013
Mar 17, 2011 at 7:22am

I format my entire disc, and everything is just fine now !
Thank you.
Ad.

#199014
Mar 17, 2011 at 3:20pm

Glad it’s working! Sorry you had to go through all that trouble, but all the same, I’m glad it’s not the external causing you grief. ;)

#199015
Mar 20, 2011 at 3:26pm

Hello cap10subtext,
thanks a lot for this external,
My Idea was to connect artoolkit with the jit.ogre external, but it seems there is a bug when i try to connect jit.ogre models and draw_pixels.
My jit.window is showing the both but flash…
do you have any suggestions?

#199016
Mar 21, 2011 at 1:19am

Hi Pulsart, check out the following post, I’ve had some issues with the jit.ogre external too (the potential is irresistible, no?) which are outlined there (including the draw_pixels issue and an animation “bug?” I’m sure you’ll come across). Rob posted a solution with a videoplane that I found worked in some situations but not in others. So I’m not sure what the ideal solution is I had a few issues with it regarding mixing it with other GL shapes (his solution is posted in that thread). Maybe it’ll work for your purposes?

http://cycling74.com/forums/topic.php?id=19126

The other thing I was having trouble with was changing the z offset and rotation transform on jit.ogre objects. But perhaps mention to Rob (or add to the jit.ogre thread) that you too would be interested in seeing if an equivalent to the gltranslate or glrotate feature could be added to the jit.ogre object?

#199017
Mar 21, 2011 at 12:05pm

I am very interested too in the possibility of integrating Artoolkit and Jit.ogre.

+1.

#199018
Jun 13, 2011 at 10:14pm

A new download has been posted:

https://github.com/downloads/cap10subtext/jit.artkmulti/jit.artkmulti-PC.zip

This is the first compile I’ve done for ARToolkit for Max/MSP/Jitter for the PC! So far tested on Windows XP. I need PC Beta testers since I have limited access to a PC. Anyone who can help me with the code is welcome to as well, there are few differences between this and the Apple compile notably the path names and a few different headers. Could also use some pointers about the resolution. 640×480 is fine on a Mac for tracking markers, it seems really pixellated on the Windows machines I’ve tried.

There were a lot of issues with this code, but instructions are all there in the README to get it working. There was a huge issue with the dlls but the ones you need are included, simple install them in the local support folder. Again I have to remind all that the code is provided AS-IS. I bear no responsibility for anything that might happen to your system as a result of using my terrible code. :)

Note the other thing different about this version is that you need to install the multi folder in your local project folder before you start your jit.artkmulti object. Otherwise it won’t find the markers and you’ll get a crash when you start the video.

#199019
Jul 14, 2011 at 7:51am

Hi cap10subtext – a quick bug report on windows 7 (not sure if its just me or everyone though), the object looks for camera_para and object_data files in C:Program FilesCycling ’74Max 5.0artk.support , although for most people it will be in C:Program Files (x86)Cycling ’74Max 5.0artk.support

I checked I have the paths set up correctly (with the (x86)) in preferences. I overcame the problem by copying artk.support to a new path where it was looking for the files.

#199020
Jul 15, 2011 at 2:54am

Thanks for the report. If anyone else has Windows 7 (64 bit) I’d appreciate knowing if that path is uniform between machines.

#199021
Jul 15, 2011 at 5:55am

New download posted on Github to correct path name to C:Program Files (x86)Cycling ’74Max 5.0artk.support for anyone else with this issue. Would love feedback as to whether this solves the problem.

Note: it’s not a 64 bit compile, it’s just the different path name.

#199022
Jul 16, 2011 at 2:39pm

Hi cap10,
Is it possible to organise artk to follow the standard max paths?
I generally keep all my foreign objects in a particular folder which is added to MaxPath.
Artk did not work from here and seemed to want to be in Max5 root. Would prefer not to symlink . .
Apart from that it seems to work. Mac i7 QC, 10.6.

Cheers

MM

#199023
Jul 18, 2011 at 4:03am

Macciza: May not be possible, there’s an issue with the function that parses the path name that won’t allow for spaces in the paths on a Mac and I think that it’s in one of the libs. Have had a hard time tracking it down and don’t know if I can recompile it.

Would also need an example of how to use the Max paths in an external.

I will keep trying.

#199024
Jul 19, 2011 at 4:23pm

Okay, after tinkering a bit I think I’ve solved the issue with spaces in the path name. Turns out it was a parsing issue in one of the classes.

If i can figure out how using a max path works for other externals I may be able to implement it after all.

#199025
Jul 20, 2011 at 12:21am

New object posted for OS X, should work with the Max File paths now. Just place the folder anywhere in the Max search paths and add this:

max fileformat .dat DATA 0 “data file” file;

into the file:

/Applications/Max5/Cycling ’74/init/max-fileformats.txt

Request to Cycling ’74 to add the Data file to max-fileformats.txt permanently.

To build a standalone, just add the camera_para.dat and the multi folder to .app/Contents/support/

https://github.com/downloads/cap10subtext/jit.artkmulti/ARToolkitMax.zip

This release works with a new format for object_data2 in /multi, so you should use the new one with the new object.

#199026
Jul 21, 2011 at 10:29am

Hi cap10subtext – I’ve tested your win7 x64 fix and it works fine for me (I have deleted the old non-(x86) folder).

I also have a question – in the windows readme, does the line “The calibration of the camera is default .dat camera file only” mean its not possible to replace the default camera_para.dat file with a user-made one?

Thanks

#199027
Jul 21, 2011 at 11:54am

It’s possible, but may not be desirable at this time. I tried a different calibration that was MacBook iSight specific and instead of improving tracking it mucked it up. Not sure what the fix for that would be at this time. If someone who knew ARToolkit front to back could point out the issue in the code I’d fix it in a heartbeat…

#199028
Jul 22, 2011 at 5:06am

Interesting. Maybe try a test dat after doing the one-step calibration yourself: I’m using a video camera (HV20) + capture stick and found it reduced flickering quite a lot (although I also changed some lighting around that time too, so I couldn’t say for sure it was just calibration).

Also another note – on your website it says to edit object_data2, but so far mine has only been reading object_data (I’ve actually renamed 2 to avoid confusion). I am only using single marker tracking (of 4 markers) though, so if thats related to multi-marker tracking, ignore this.

Thanks for producing this external – its awesome and just what I need for a project I’m doing in a nail salon soon. The only challenge at the moment is how temperamental artoolkit is – every morning I load up the working patch from last night and have to find out why its now crashing.

But this seems to be the way with the standalone artoolkit binaries too (crashing if the camera is the wrong kind, or the marker file isn’t found). I guess its the price of working with such specialist tools.

#199029
Jul 22, 2011 at 8:07am

I just checked and the alignment is in fact better with the default file. (Assuming that the dat file doesn’t influence the tracking, and only affects the alignment of objects rendered.)

This could be because I failed to play with the lens_angle and position offsets to counter the new alignment, but to my eye the default is good enough for me.

#199030
Jul 22, 2011 at 12:53pm

Thanks for the kind words. It’s been a dream of mine for the longest time to get something working natively in Max but of course it’s come together finally now that I barely have time to work on it. So I apologize for the crashing, I just haven’t had the time to to do all the error checking that the open source ARToolkit seems to lack to make it play nice with Max.

And I apologize in advance that the windows versions won’t get quite the same level of attention because frankly I hate using windows. Would be more than happy to post the Visual Studio 2008 or 2010 project files if someone wants to help maintain it.

And for windows it is object_data not object_data2. As I said, not a lot of time to throw this together so my naming conventions are out of whack! :)

#199031
Jul 22, 2011 at 1:02pm

Oh and regarding the calibration, it’s because there’s a bit of a hack involved to get a coordinate system that works with out too much fiddling in Max. In ARToolkit, I believe there is an extra step they do to apply the resulting projection Matrix from the camera file to the transformation matrix but it’s done as a rendering step in OpenGL (I could be mistaken about certain details) which make calls to the glu viewport which we aren’t using in Max so I just bypassed it and corrected the tracking to work with the default file. Ulitmately would love to have it work properly but I’d need to pick the brain of an ARToolkit expert and a better C programmer than I.

#199032
Aug 5, 2011 at 9:12pm

New object posted for Windows, this object loads properly on my machine (XP SP 3) but I’m having all sorts of unrelated webcam issues and can’t test it properly. Please let me know if it’s not working for you.

This release should work with the Max File paths now, therefore the x86 path fix should be no longer necessary, please feel free to report any bugs. Just place the support folder anywhere in the Max search paths and REMEMBER to add this:

max fileformat .dat DATA 0 “data file” file;

into the file:

Program FilesCycling ’74Max 5Cycling ’74initmax-fileformats.txt (or the Runtime equivalent).

I’d like to request to Cycling ’74 to add the Data file to max-fileformats.txt permanently, if anyone has any complaints or a conflicting standard please let me know.

Have never built a PC standalone but should work when dlls, camera params and multi folder copied to support folder.

https://github.com/downloads/cap10subtext/jit.artkmulti/ArtoolkitMaxPC.rar

This release works with a new format for object_data2 (note it no longer supports object_data from the original download) in multi. Please erase old support folders in your path to avoid a conflict.

Copy of GPL license added to PC release.

#199033
Aug 6, 2011 at 1:25pm

Hi cap10subtext – thanks for the update. I’ve had the previous version running without issues since a while after my last post, once I narrowed down some ‘rules’ to avoid crashes. Basically the bullet-proof way to launch it for me is by double-clicking the patch I want to edit while Max is closed. The fact opening it from the file menu in Max doesn’t work makes me suspect it might be related to filepaths, so maybe this new version will fix that.

I’ve created a rough proof-of-concept of an automatic-thresholder for single black and white markers. It should reduce drop-outs due to changes in light like glare or shadows. I’m about to move to colour markers, so I won’t have time to work further on it. I think a lot of the heavy lifting involved could be moved to the GPU, but at the moment it isn’t too intensive.

It’s very rough so I think the patching that determines how often it runs doesn’t actually work properly (did it late at night) and the patching in general is just how it came out while working through the problem (this is the first patch I’ve posted).

Additional improvements could include running the 3m on each plane for colour markers (and only using full/zero RGB values on the markers like 255 0 0 / 255 255 0 /0 0 0), or running for a few frames after losing the marker and widening the sample radius (in case it can pick it up again in the same area with more contrast data). Note the patch is looking for marker 2.

– Pasted Max Patch, click to expand. –
#199034
Aug 8, 2011 at 4:15pm

“Basically the bullet-proof way to launch it for me is by double-clicking the patch I want to edit while Max is closed. The fact opening it from the file menu in Max doesn’t work makes me suspect it might be related to filepaths, so maybe this new version will fix that.”

Hmmm… interesting about the file menu issue, hadn’t noticed that. Hopefully this does get resolved with the latest update.

Glad it’s working out for you. The way I see it, there are likely 3 more very important issues, however, it’s possible that they will never fully be resolved.
1) I need to figure out how to properly handle the memory of this object. I have an example which I’m waiting on which should give me an idea of how to accomplish this by properly allocating memory to the loading of the marker “objects”.
2) There doesn’t seem to be a way to safely handle the ARToolkit libraries, the normal cleanup routines don’t have any effect.
3) there must be a way to correct for the proper camera calibration files but this totally escapes me at the moment. You can see when the marker gets further from the camera the skew becomes more obvious.

The final issue which is less pressing is that the “detection” output is still not precise… It seems to have trouble with multiple markers entering and leaving the scene simultaneously.

Having said all of that, I like where you are going with this patch (you are right in that it seemed to attempt the fix once, then it would stop working). Happy augmenting!

#199035
Sep 5, 2011 at 3:35am

I’m trying to move from single markers to multiple markers now (tracking multiple independent object, not single-position multi-pattern markers), but I’m not 100% sure if the object is supposed to support this.

At the moment I have 4 patterns loaded, but when multiple patterns are on screen, the object will only output position data for one. If I cover that marker up, it will switch to outputting another. Is the multi-marker tracking only for the kind of multi-pattern, single point tracking shown here: http://www.hitl.washington.edu/artoolkit/documentation/tutorialmulti.htm or is something wrong in my objectdata formatting etc.?

Additionally, I realised I was needlessly recreating cv.jit.threshold above, so I’ve switched to that for much more stable marker detection in changing lighting conditions. I’d like to find a shader that does something similar, as all the cv objects can slow things down a lot, but I’ve yet to come across one other than a pixelbender script.

#199036
Sep 6, 2011 at 2:26pm

It’s supposed to run on 4 independent markers. As long as any of them track it’s probably not an issue with object_data.

Which object are you using again? Can you remind me? Is it the most current one with the fixed path on PC?

Someone pointed out a bug to me recently which I’ve been working on but it sounded more innocuous than the one you described. Basically they all tracked but the first element of the lists (visible 1/0) was not updating properly if all objects were removed from the scene at once.

If you are using the PC version it’s possible I mucked something up in the translation between Mac and PC, I was getting some errors I’d never dealt with before in VS.

If you send me more details I will do my best to investigate. Perhaps even a patch that illustrates the problem? I find recording a little video and using that for the live feed makes it easier to replicate the issue.

Sorry for the inconvenience…

#199037
Sep 6, 2011 at 4:23pm

Hey cap10subtext, thanks for the response. No worries about the inconvenience – thanks for releasing and supporting the object in the first place!

I’ve uploaded a quick demo video using the help patch (with added thresholder) here: http://www.youtube.com/watch?v=m4pBPfnWhPg

You can see it clearest by watching which message boxes get updated (only one per frame). I haven’t been able to recognise a pattern to which marker it ‘chooses’ yet. Please forgive the noisy signal too – its night here.

I’m using the most recent object- but I’ve checked the previous one and it shows the same behaviour.

Here is the content of my multi directory: http://www.bferns.com/files/multi.zip

And the patch and Max window output:

– Pasted Max Patch, click to expand. –

Jitter 1.7.0 installed
cosm version: ‘Mad Professor’
*** Initializing ARToolkit for Max/MSP***

ARToolkit Property of ARToolworks

Max External by Andrew Roth — aroth21@yorku.ca

Alpha Release Only – r004

Image size (x,y) = (640,480)

Opening Data File /Program Files (x86)/Cycling ’74/Max 5.0/artkmulti support/multi/object_data2

About to load 4 Markers

Marker finger1 from oulet 1

Marker finger2 from oulet 2

Marker finger3 from oulet 3

Marker finger4 from oulet 4

—>>> Objectfile num = 4

jit.gl.render: building GL on window “artoolkit”…

#199038
Sep 20, 2011 at 12:04pm

Hi, I have a problem with jit.artkmulti. I don't understand where is error.

Thanks

[attachment=171167,2645]

Attachments:
  1. Picture38.png
#199039
Sep 20, 2011 at 12:12pm

My guess is that you haven’t added the following line:

max fileformat .dat DATA 0 “data file” file;

into the text file:

Applications/Max5/Cycling ’74/init/max-fileformats.txt

Then restart. Max doesn’t natively recognize .dat files in the search path.

#199040
Sep 20, 2011 at 12:33pm

I add this line, I restart, max and my computer but I have the same errors:

Camera Params at: /Applications/Max5/artk.support/camera_para.dat
Camera parameter load error!!

Opening Data File /Applications/Max5/artk.support/multi/object_data2

Can’t find the file – quitting

—>>> Objectfile num = 0

#199041
Sep 20, 2011 at 1:35pm

From your screenshot it looks like you are using an older version of the external. I could be mistaken, but try downloading the latest one from aranarproductions.com/artk and if that doesn’t help, I’ll look into it as soon as possible.

#199042
Sep 20, 2011 at 1:58pm

I reinstall the last version from site, still same errors.

I use Mac OS X 10.5.8
Max Msp 5.1.7
Xcode 3.0

I just update Java

These are the messages from max window

*** Initializing ARToolkit for Max/MSP***

ARToolkit Property of ARToolworks

Max External by Andrew Roth — aroth21@yorku.ca

Alpha Release Only – r002

Image size (x,y) = (640,480)

Camera Params at: /Applications/Max5/artk.support/camera_para.dat
Camera parameter load error!!

Opening Data File /Applications/Max5/artk.support/multi/object_data2

Can’t find the file – quitting

—>>> Objectfile num = 0

#199043
Sep 20, 2011 at 4:22pm

Okay, totally my fault. It was a bad link on that page. Fixed now.

This should be the direct download to the new one:

https://github.com/downloads/cap10subtext/jit.artkmulti/ARToolkitMax.zip

It should be r003.

Delete the old, and dump in the new.

#199044
Sep 21, 2011 at 1:23pm

I have a problem with the barcodes not being tracked at all. I am on win xp, I have downloaded the win pc of artoolkit, i have followed the readme instructions as well. I am not sure what I am doing wrong…

#199045
Sep 21, 2011 at 1:31pm

One possibility Adity: if the webcam is being mirrored in your webcam manager it likely won’t work.

Also if you opened the patch, closed it and reopened it, or made an object and then opened the help patch, it causes the output to cease completely. Only way to get it going again is restarting Max. Totally inconvenient, I know.

#199046
Sep 22, 2011 at 5:54am

Thank you very much for all. Now it works like charsm

#199047
Sep 22, 2011 at 3:09pm

pecta: Glad to hear it! Sorry for the inconvenience.

adityapretzelz: feel free to post screen shots, sometimes that helps determine the problem.

#199048
Sep 22, 2011 at 4:04pm

I have another question: What format must be the markers. On http://www.roarmot.co.nz/ar/ they save in pdf format.

I saw in multi folder a strange format .

Thank for your patience.

#199049
Sep 22, 2011 at 4:17pm

Perhaps the newer versions of ARToolkit accept that format; however, the open source one still requires a patt format.

Confusingly the files in the multi folder are called patt.a, etc…

You can use the site you posted to create and print a marker, but then you should go the the following site to create the .patt file you need to add:
http://flash.tarotaro.org/blog/2009/07/12/mgo2/
(set image segments to 16×16)
Put your new patterns in the multi folder, and edit object_data in a text editor (word pad or text edit) to add the name of the marker and a descriptor (one word no spaces) so the Max window will tell you which outlet the position reports from. I suggest making a backup copy of object_data.

For more information on making markers:

http://www.artoolworks.com/support/library/Creating_and_training_new_ARToolKit_markers

#199050
Sep 22, 2011 at 5:23pm

I made using http://flash.tarotaro.org/blog/2009/07/12/mgo2/ a j.patt file . I can use this or must change something to have a file equivalent with patt.c?

#199051
Sep 22, 2011 at 5:30pm

pecta – MGO2 should work fine. You can also use http://saqoo.sh/a/en/676 as a downloadable AIR app. People have found they give different results, so experimentation is the best way to go.

If you have a relatively simple pattern some people have found greater success by hand-editing the pattern files in a text editor (it will hopefully be clear when you open it – RGB values in multiple fixed-width columns and rotations).

Also although ARTK+ and some modifications accept colour markers, I think with ARTK you’re stuck with black and white, despite the RGB marker data; but thats just an assumption I made from some old documentation.

#199052
Sep 22, 2011 at 5:37pm

Mgo2 work fine but my confusion is related with the output file from MGO2. It is a j.patt. In multi every file is patt.a, patt.c , etc.

On http://www.artoolworks.com/support/library/Creating_and_training_new_ARToolKit_markers it is not very clear how i change from j.patt to patt.j.

thanks

#199053
Sep 22, 2011 at 5:49pm

you can just rename the file from j.patt to patt.j

#199054
Sep 25, 2011 at 5:05pm

Note: just installed 5.1.9, had to re-add the DATA file format back to the text file to make it recognize camera_param.dat

#199055
Oct 15, 2011 at 6:33pm

Jit.artkmulti works on Max 6, but the help file doesn’t.

Improvements en route… Stay tuned.

#199056
Oct 27, 2011 at 4:39pm

First steps into a new help file. Haven’t had time to put a proper one together yet but this should solve the basic issues with draw_pixels being deprecated.

By the way, there seems to be an issue with the model not loading at the correct scale. I could just be doing something wrong… but scale it up manually and it works.

– Pasted Max Patch, click to expand. –
#199057
Sep 3, 2012 at 12:31am

Thanks for this great work. It’s really sweat to have all-axis fiducials in Max :)

Is there a clear list of what the 14 floats are for the outlets in [jit.artkmulti]? Also, what is the scale of those outputs?
I’m having a hard time trying to figuring out how to recreate it in gl, tying rotation to rotation attributes, etc.
here is my patch, if it helps.

thanks,
mattt.

– Pasted Max Patch, click to expand. –
#199058
Sep 6, 2012 at 3:28pm

Hi matt, the list of outputs should be in the earlier help files. I’ve attached a version to the bottom of this post.
jit.artkmulti outputs a list with the following elements:
1. marker visible? (enable $1)
2., 3., 4., 5., rotation in Axis-Angle {w, x, y, z} < --- note the scale of this is Axis-Angle (WXYZ) which is different from the Euler Angles (XYZ) you are attempting to control. You'll have to do a little reading.
6., 7., 8., position {x, y, z}

Are you on Max 5? The only way to “properly” do this in Max 5 is to hand over the rendering of the objects to jit.gl.sketch because you need to do the transforms hierarchically using rotation, position then gltranslate (inherited position) and glrotate (inherited rotation), but I’m not sure if it’s possible to do with text objects (I can’t recall ever trying). To do that you’d have to look at the jit.gl.sketch help file and the draw_matrix command.

In Max 6 this is easy because of the anim.gl.node objects which allow for hierarchical transformations without needing gltranslate and glrotate.

If you are going to be doing more AR/VR stuff and you want to use Max, I really suggest using Max 6 wherever possible. It’s so much easier.

Hope this helps?


----------begin_max5_patcher----------
4322.3oc6cs0jaaaE940+JPU8CIYjkItva4k3sc5zIyT2lwI8gN1YzPIAokd
oHUHo7ta73+6EffRhbEkDHIHEoMi2Ua3UcvG.N3fuyAG74WbynYAORiFA9Qv
6A2bymewM2jbJ9ItI83aFs14w4dNQI21n4AqWS8iGMVbsX5iwhyemi+JJXdf
mmajafO3cNK.emqOH9tfsQN9Kh99cOimqOcdvV+jGDkdxkA9wQt+IkeNHZhV
5o23DO+NW+USCoyiExogMgcY.Dqm7GaM9evryA98zGxe6ZWeOZbhDCObxfsw
6N6t2u6hDoOX1Gek9nLhhuy5DQYzsgtNdi3W3Ku3E7OFKIPszKf8UNpzEOSh
QR4xLoTRRJjHsxU5PGW5rNSoK8JhWP7SanBIgWDbX0zfQyX0si.+dEPAe5Cr
u8iZsrw4dQSkET.bR4AICKh.WRvJK34AITgfD7XPxtBfT0vkS0M5itwSV4MI
5dJqLCb77BdHB7TvVPb.XaDErxKNzwOxyIlBXcpXGGFDyOfc8fkKinwImN4l
VFDtl08iBXEMFxMov9ejRi8DrnGGRzNUO4HCTs6+QTa+umgvexIb+6zYabvc
TuMSiC1Lcg6JZT76g+9Q0E+sm.25uHj9.3cAw28A++4u7u.dtyo9yoev++ED
dO3+569IZXja7SEhs3hwVSchol9tqEtZl.W0lfLGy9Dqy+jv9+gYvzBpHzSp
mXJBS9TzUP+hZJ3EOVWufPY9VuXkFVsUZ7l+K2DsZqa40IPRTInaZknRPzF0
n15MQUQkvXUqVXsaXXPXRmY20Nqn+T4gGa6jlIFvL8ZK63JEMpoVi1s841Wj
nNSnmKXYxQqc1rg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qj9OX5oCclw
CUSdbZV4PsEmtjrMUz39Ps5Eqsia.r5r6KFRsQmizghPmpRl.nW.LUUqix9a
kvoMN9TuKtmVj6tVycaRlRWg80DNDQrTDDNeGcITZly76Wwrf0eQ1yxZVu.t
yEwVFi2+YxdKVY1yI1mvlSdmncuSSqj2IIyaNGRl7EjmZMAv97IwmBuGGLM4
hkJYl49wyZu3YreTcsrhDTFQBCaWYBJgL8LA+hxDOm5pKxTGb5rw6OntBKpI
DVyFRXIMfvVSYhOomCKdVYnoUB7SOYOhDQRPNrlw9ipK.lMH2NE4r4xQuWVX
4Cdv8j.V30X9g6NRARqlLRaIf1TvDiSSzXj8GUSgU2TFMQlsaaSSY0NBaMYB
KSsJpc0XaJiRPBtUkICYFYy.28z0YnUYkcIwiwgipq5CrLiVPZeDDeoV+kDA
QYFfX2vspXzBjTcUa2gaMvMfLk1nCKHDU.fXQDPVe.7Ri21tCIjOP96FCSIU
yLiJNNOTjoFObTcGmGKqzBaU.7RMyvkrOwdy5DHHAoqJDDaIiccsaSPrgrxD
rS0s.WMyeQlI6g1Xj49iZilfjp0DLUZIPhJk1KYGCQq0UBdICCHsK4JDY5TT
RK0I1VYr1KyTaqqVEhLZURJQ31C.MkUlPslLICLY2p54rUeqLCarLDnvN3Ku
3+++cSjA
-----------end_max5_patcher-----------
#199059
Nov 7, 2012 at 3:03pm

hey,

i have upgraded the support patch a bit. you can load 4 obj files and they also disappear when the marker is not visible. hope this is helpful for someone :)

lci

#199060
Nov 7, 2012 at 9:20pm

Thanks for contributing! I haven’t had a chance to look at this in a while, it was originally designed so that $1 would tell you if the marker was visible or not but some users were reporting that it didn’t work perfectly with multiple markers. How does your approach work when you add and remove single markers from the scene?

#199061
Dec 12, 2013 at 2:21am

Hey

I’m trying to use arToolkit on Max 6. I open the help file but when I start the qmetro max only shows my the rendered image, the virtual one. But I can’t see me on the screen, do I have to put anything else in the patch to to that?

I’m running it in a 10.6 OSx

Thanks!

#275490

You must be logged in to reply to this topic.