ARToolKit | Mailing List Archive |
![]() |
From: | Rodney Berry <rodney@a ........> | Received: | Feb 26, 2003 |
To | ARToolkit Mailing list <artoolkit@h ..................> | ||
Subject: | javascript and vrml | ||
hi all, has anyone managed to get javascript working with ARToolkit. from what I understand, OpenVRML needs to be compiled with javascript (mozilla Spidermonkey) enabled. we are hoping to add in some extra javascript commands to allow more dialogue between the vrml models and the parent application as well a socket connections to the outside world. The script node would provide a conduit between the javascript api and the models themselves. anyone had a go at this already? Rod (I still want a ARToolkit-toolkit) Berry |
From: | Rodney Berry <rodney@a ........> | Received: | Feb 26, 2003 |
To | ARToolkit Mailing list <artoolkit@h ..................> | ||
Subject: | javascript and vrml | ||
hi all, has anyone managed to get javascript working with ARToolkit. from what I understand, OpenVRML needs to be compiled with javascript (mozilla Spidermonkey) enabled. we are hoping to add in some extra javascript commands to allow more dialogue between the vrml models and the parent application as well a socket connections to the outside world. The script node would provide a conduit between the javascript api and the models themselves. anyone had a go at this already? Rod (I still want a ARToolkit-toolkit) Berry |
From: | Rodney Berry <rodney@a ........> | Received: | Feb 28, 2003 |
To | Joey Julien <joey.julien@b ........>, ARToolkit Mailing list <artoolkit@h ..................> | ||
Subject: | Re: javascript and vrml | ||
HI Joey, which version of ARToolkit and which Openvrml and which Spidermonkey are you using? We are just getting started and have never managed to get it to work. It is taking a long time to learn about scripting in vrml, not having a programming background. I have a half-baked plan to add some new commands to the javascript API to directly open up a socket connection (something javascript won't do of course for reasons of web security etc.) I get the impression that Java in openvrml is too flakey to manage such a thing? I got a note from one of the OVRLML people saying that java only works if you can compile the JDK with the same compiler that you compiled OpenVRML with otherwise "...it'll just segfault on the first dynamic_cast." according to Tom Flynn. Anyway, perhaps some folk could suggest what kind of commands that should be added in. so far I am thinking along the following lines... 1. a net-send object that takes a port number and protocol (TCP orUDP) as its arguments. 2. a net receive object that listens on the named port for messages. 3. some objects that let you talk to the 'top world' as seen by the camera and let you get information about where markers are in the camera's space as well as the camera's location. The whole thing would be messy to use of course but it would enable us to build some generic ARToolkit applications that an artist (or a 'naive' programmer like me) could then mess with via VRML and javascript without having to manage C compiling into the bargain. Of course, a whole new architecture might, in the long tun, be simpler to use. However, VRML and javascript are already well documented by lots of good authors so a manual could be focussed on the issues of brigding them together with an AR environment. In addition, we could use the (as yet non-existent) javascript socket commands to just act as traffic control then build up the desired behaviour for our world in another program such as Macromedia Director, flash, Max,PD, or python, Tcl or any other thing that can open up a socket and send a string through it. I am keen to hear peoples' suggestions as to what form these added commands might take. Rodney Joey Julien wrote: > Yes, been using the VRML Script{} node for files ref'd by the toolkit with > quite a lot of success. The main issue is that it currently only seems > possible to access nodes within the VRML file that the Script{} node is > located. W > > ould be nice to have access to vrml files associated to additional patterns > through an ARtoolKit API/socket as you mention. > > Joey > > -----Original Message----- > From: Rodney Berry [mailto:rodney@a ........] > Sent: 26 February 2003 05:22 > To: ARToolkit Mailing list > Subject: javascript and vrml > > > hi all, > > has anyone managed to get javascript working with ARToolkit. > > from what I understand, OpenVRML needs to be compiled with javascript > (mozilla Spidermonkey) enabled. > > we are hoping to add in some extra javascript commands to allow more > dialogue between the vrml models and the parent application as well a > socket connections to the outside world. The script node would provide a > conduit between the javascript api and the models themselves. > > anyone had a go at this already? > > Rod (I still want a ARToolkit-toolkit) Berry > > > > BBCi at http://www.bbc.co.uk/ > > This e-mail (and any attachments) is confidential and may contain > personal views which are not the views of the BBC unless specifically > stated. > If you have received it in error, please delete it from your system, do > not use, copy or disclose the information in any way nor act in > reliance on it and notify the sender immediately. Please note that the > BBC monitors e-mails sent or received. Further communication will > signify your consent to this. > > > > |
From: | Rodney Berry <rodney@a ........> | Received: | Feb 28, 2003 |
To | Joey Julien <joey.julien@b ........>, ARToolkit Mailing list <artoolkit@h ..................> | ||
Subject: | Re: javascript and vrml | ||
HI Joey, which version of ARToolkit and which Openvrml and which Spidermonkey are you using? We are just getting started and have never managed to get it to work. It is taking a long time to learn about scripting in vrml, not having a programming background. I have a half-baked plan to add some new commands to the javascript API to directly open up a socket connection (something javascript won't do of course for reasons of web security etc.) I get the impression that Java in openvrml is too flakey to manage such a thing? I got a note from one of the OVRLML people saying that java only works if you can compile the JDK with the same compiler that you compiled OpenVRML with otherwise "...it'll just segfault on the first dynamic_cast." according to Tom Flynn. Anyway, perhaps some folk could suggest what kind of commands that should be added in. so far I am thinking along the following lines... 1. a net-send object that takes a port number and protocol (TCP orUDP) as its arguments. 2. a net receive object that listens on the named port for messages. 3. some objects that let you talk to the 'top world' as seen by the camera and let you get information about where markers are in the camera's space as well as the camera's location. The whole thing would be messy to use of course but it would enable us to build some generic ARToolkit applications that an artist (or a 'naive' programmer like me) could then mess with via VRML and javascript without having to manage C compiling into the bargain. Of course, a whole new architecture might, in the long tun, be simpler to use. However, VRML and javascript are already well documented by lots of good authors so a manual could be focussed on the issues of brigding them together with an AR environment. In addition, we could use the (as yet non-existent) javascript socket commands to just act as traffic control then build up the desired behaviour for our world in another program such as Macromedia Director, flash, Max,PD, or python, Tcl or any other thing that can open up a socket and send a string through it. I am keen to hear peoples' suggestions as to what form these added commands might take. Rodney Joey Julien wrote: > Yes, been using the VRML Script{} node for files ref'd by the toolkit with > quite a lot of success. The main issue is that it currently only seems > possible to access nodes within the VRML file that the Script{} node is > located. W > > ould be nice to have access to vrml files associated to additional patterns > through an ARtoolKit API/socket as you mention. > > Joey > > -----Original Message----- > From: Rodney Berry [mailto:rodney@a ........] > Sent: 26 February 2003 05:22 > To: ARToolkit Mailing list > Subject: javascript and vrml > > > hi all, > > has anyone managed to get javascript working with ARToolkit. > > from what I understand, OpenVRML needs to be compiled with javascript > (mozilla Spidermonkey) enabled. > > we are hoping to add in some extra javascript commands to allow more > dialogue between the vrml models and the parent application as well a > socket connections to the outside world. The script node would provide a > conduit between the javascript api and the models themselves. > > anyone had a go at this already? > > Rod (I still want a ARToolkit-toolkit) Berry > > > > BBCi at http://www.bbc.co.uk/ > > This e-mail (and any attachments) is confidential and may contain > personal views which are not the views of the BBC unless specifically > stated. > If you have received it in error, please delete it from your system, do > not use, copy or disclose the information in any way nor act in > reliance on it and notify the sender immediately. Please note that the > BBC monitors e-mails sent or received. Further communication will > signify your consent to this. > > > > |
From: | "Joey Julien" <joey.julien@b ........> | Received: | Mar 3, 2003 |
To | "Rodney Berry" <rodney@a ........> | ||
Subject: | RE: javascript and vrml | ||
Hi Rodney, Not sure which version of the ARToolKit I'm using exactly but my understanding is that support for the Script node is more or less determined by the compatibility of the OpenVRML engine with the VRML 97 spec. Didn't have to use any special tricks to get the Script node working though noticed a few compatibility issues: 1/ no initialize() function called when file loads 2/ you can can use Browser.print() method within the script to output variables to command line (useful for debugging) 3/ the TimeSensor doesn't seem to send an SFTime cycleTime event when ROUTE'd to a Script node. 4/ Couldn't get the following sensors to work: CylinderSensor, SphereSensor, PlaneSensor (all mouse related), VisibilitySensor 5/ Made use of Math functions, eg. Math.floor(), Math.PI, etc. 6/ Made use of javascript Switch syntax, also for loops. 7/ Neither PROTOS nor EXTERNPROTOS are supported which is a shame since this would provide an object oriented method of generating objects on-the-fly. Here's a list of the most effective nodes that I've found when used in conjunction of the Script node and the ARToolKit: Switch{} Placing different content in a Switch node that is revealed when an even happens ie. cycling through a calendar of months in an animation of the earth going around the sun. Proximity{} Setting the bounding box to a large value on ROUTEing the position & orientation information of the camera into a Script node ie. establishing the distance of an object from camera and triggering specific frames of an animation Useful standard nodes: Billboard{} For keeping signs & info facing the camera (seems to be inverted in ARToolKit) LOD{} Swapping lo-res versions of models at distance from camera IndexedLineSet{} Good for annotations n.b. these are not exhaustive by any means, just elements encountered so far, uses the following script reference as a guideline <http://www.web3d.org/technicalinfo/specifications/vrml97/part1/javascript.html#BrowserClass> I agree with your premise of providing a generic ARToolKit that you can script behaviours from within the VRML file without having to touch the source code of the ARToolKit. I think the most important thing in this case is to be the ability to access the whole scene graph from a single file since is seems that currently, separate instances of files are associated with unique patterns. Perhaps specific DEF'd grouping nodes could be associated with unique patterns so that only one file would need to be used, the ARToolKit could then update the position & orientation these nodes to match that of tracked patterns. Some additional ARToolKit specific events would be useful to capture from the Script node such as when a pattern is being tracked and when is stops being tracked. Best, Joey -----Original Message----- From: Rodney Berry [mailto:rodney@a ........] Sent: 02 March 2003 04:50 AM To: Joey Julien Subject: Re: javascript and vrml Hi Joey, I am getting stuck into this at present so I am writing to grill you for info about using scripts with ARToolkit. Which version are you using and were there any special tricks you had to pull to get it to work with javascript? I am really keen to try to fill in the missing links between the vrml models and the outside world, both from the camera's perspective (proximity etc.) and from other programs via sockets. I believe that this will provide an awkward and ugly but useable stepping stone toward a true 'ARToolkit-Toolkit' for non-C-programmers. I have bought a C++ for morons book and installed a compiler but it will be some time before my skill gets to a level that I can really use the ARToolkit as it stands. any thoughts and suggestions are most welcome at present as all the programmers I work with do not speak english so I am battling two language barriers simultaneously. I often sit next to one of the programmers searching through english web pages for code examples then he can read the code that I can't read. It's slow but it works. :) Best wishes, Rodney Joey Julien wrote: BBCi at http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system, do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. |
From: | "Joey Julien" <joey.julien@b ........> | Received: | Mar 3, 2003 |
To | "Rodney Berry" <rodney@a ........> | ||
Subject: | RE: javascript and vrml | ||
Hi Rodney, Not sure which version of the ARToolKit I'm using exactly but my understanding is that support for the Script node is more or less determined by the compatibility of the OpenVRML engine with the VRML 97 spec. Didn't have to use any special tricks to get the Script node working though noticed a few compatibility issues: 1/ no initialize() function called when file loads 2/ you can can use Browser.print() method within the script to output variables to command line (useful for debugging) 3/ the TimeSensor doesn't seem to send an SFTime cycleTime event when ROUTE'd to a Script node. 4/ Couldn't get the following sensors to work: CylinderSensor, SphereSensor, PlaneSensor (all mouse related), VisibilitySensor 5/ Made use of Math functions, eg. Math.floor(), Math.PI, etc. 6/ Made use of javascript Switch syntax, also for loops. 7/ Neither PROTOS nor EXTERNPROTOS are supported which is a shame since this would provide an object oriented method of generating objects on-the-fly. Here's a list of the most effective nodes that I've found when used in conjunction of the Script node and the ARToolKit: Switch{} Placing different content in a Switch node that is revealed when an even happens ie. cycling through a calendar of months in an animation of the earth going around the sun. Proximity{} Setting the bounding box to a large value on ROUTEing the position & orientation information of the camera into a Script node ie. establishing the distance of an object from camera and triggering specific frames of an animation Useful standard nodes: Billboard{} For keeping signs & info facing the camera (seems to be inverted in ARToolKit) LOD{} Swapping lo-res versions of models at distance from camera IndexedLineSet{} Good for annotations n.b. these are not exhaustive by any means, just elements encountered so far, uses the following script reference as a guideline <http://www.web3d.org/technicalinfo/specifications/vrml97/part1/javascript.html#BrowserClass> I agree with your premise of providing a generic ARToolKit that you can script behaviours from within the VRML file without having to touch the source code of the ARToolKit. I think the most important thing in this case is to be the ability to access the whole scene graph from a single file since is seems that currently, separate instances of files are associated with unique patterns. Perhaps specific DEF'd grouping nodes could be associated with unique patterns so that only one file would need to be used, the ARToolKit could then update the position & orientation these nodes to match that of tracked patterns. Some additional ARToolKit specific events would be useful to capture from the Script node such as when a pattern is being tracked and when is stops being tracked. Best, Joey -----Original Message----- From: Rodney Berry [mailto:rodney@a ........] Sent: 02 March 2003 04:50 AM To: Joey Julien Subject: Re: javascript and vrml Hi Joey, I am getting stuck into this at present so I am writing to grill you for info about using scripts with ARToolkit. Which version are you using and were there any special tricks you had to pull to get it to work with javascript? I am really keen to try to fill in the missing links between the vrml models and the outside world, both from the camera's perspective (proximity etc.) and from other programs via sockets. I believe that this will provide an awkward and ugly but useable stepping stone toward a true 'ARToolkit-Toolkit' for non-C-programmers. I have bought a C++ for morons book and installed a compiler but it will be some time before my skill gets to a level that I can really use the ARToolkit as it stands. any thoughts and suggestions are most welcome at present as all the programmers I work with do not speak english so I am battling two language barriers simultaneously. I often sit next to one of the programmers searching through english web pages for code examples then he can read the code that I can't read. It's slow but it works. :) Best wishes, Rodney Joey Julien wrote: BBCi at http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system, do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. |