[x3d-public] Making SAI scripting work with DOM Scripting. Constructors.

John Carlson yottzumm at gmail.com
Fri Apr 24 11:25:07 PDT 2020


Here's my first attempt at shimming in SAI into X3DOM.  There's a lot
more than this, found in Script.js in X3DJSONLD/src/main/node (ask me for a
direct link if your really interested).

  console.log("var MFBool = x3dom.fields.MFBoolean;");
console.log("var MFColor = x3dom.fields.MFColor;");
console.log("var MFColorRGBA = x3dom.fields.MFColorRGBA;");
console.log("var MFDouble = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFFloat = x3dom.fields.MFFloat;");
console.log("var MFImage = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFInt32 = x3dom.fields.MFInt32;");
console.log("var MFMatrix3d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFMatrix3f = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFMatrix4d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFMatrix4f = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFNode = x3dom.fields.MFNode;");
console.log("var MFRotation = x3dom.fields.MFRotation;");
console.log("var MFString = x3dom.fields.MFString;");
console.log("var MFTime = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFVec2d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFVec2f = x3dom.fields.MFVec2f;");
console.log("var MFVec3d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFVec3f = x3dom.fields.MFVec3f;");
console.log("var MFVec4d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var MFVec4f = function() { return
Array.prototype.slice.call(arguments, 0); };");

console.log("var SFBool = Boolean;");

console.log("var SFColor = x3dom.fields.SFColor;");
console.log("var SFColorRGBA = x3dom.fields.SFColorRGBA;");

console.log("var SFDouble = Number;");
console.log("var SFFloat = Number;");
console.log("var SFInt32 = Number;");

console.log("var SFImage = x3dom.fields.SFImage;");
console.log("var SFMatrix3d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var SFMatrix3f = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var SFMatrix4d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var SFMatrix4f = x3dom.fields.SFMatrix4f;");
console.log("var SFNode = x3dom.fields.SFNode;");
console.log("var Quaternion = x3dom.fields.Quaternion;");

console.log("var SFString = String;");
console.log("var SFTime = Number;");

console.log("var SFVec2d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var SFVec2f = x3dom.fields.SFVec2f;");
console.log("var SFVec3d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var SFVec3f = x3dom.fields.SFVec3f;");
console.log("var SFVec4d = function() { return
Array.prototype.slice.call(arguments, 0); };");
console.log("var SFVec4f = x3dom.fields.SFVec4f;");

Note that MFNode and SFNode are ready to use in X3DOM already!

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200424/05b3efbd/attachment.html>


More information about the x3d-public mailing list