Pixel Perfect Worlds

Instructions for adding the animation script

  1. Export the frames of your animation from MagicaVoxel and bring them into Spark
  2. Download the two linked scripts in this post (animScript.js and names.js)
  3. Drag the Scripts and your Models into Spark so that they appear in the Assets Folder
  4. Create a Null Object and then parent (drag the 3D models) onto the null object, this will group the frames of the animation in one place.
  5. Click on AnimScript.js and click the '+' where it says "To Script".
  6. Select a number to create a variable and name it "frameIn"
  7. Follow the images in this presentation to create a patch for that variable


names.js
// Load in the required modulesconst Patches = require('Patches');const Scene = require('Scene');const Diagnostics = require('Diagnostics');

let parentNames = ["AnimObject0""Animation"]

let parentsArray = []let childArray = [];let totalFrames = 0;
// Enable async/await in JS [part 1](async function () {  let name = ""
  for (let anim = 0anim < parentNames.lengthanim++) {    // Locate the animation parent in the Scene    [parentsArray[anim]] = await Promise.all([      Scene.root.findFirst(parentNames[anim])    ]);  }
  //locate the text object in the scene (for debugging)  const [thetext] = await Promise.all([    Scene.root.findFirst('text0')  ]);
  // Get the parent object's children  and log their names to the console  for (let anim = 0anim < parentNames.lengthanim++) {    const children = await parentsArray[anim].findByPath('*');    childArray[anim] = children  }

  // Enable async/await in JS [part 2]})();
Patches.outputs.getScalar('frameIn').then(event => {  event.monitor({}).subscribe(function (values) {    // Diagnostics.log("To Script Number ".concat(values.newValue.toString()));    let frame = values.newValue    totalFrames++
    for (let anim = 0anim < parentNames.lengthanim++) {      if (childArray[anim] != null) {        for (var i = 0i < childArray[anim].lengthi++) {          childArray[anim][i].hidden = !(totalFrames % childArray[anim].length == i);        }      }    }  });});

  // Diagnostics.log(`Child ${i} name: ${children[i].name}`);

Welcome to Planet AR where you can transform everyday spaces into a whole new realm of discoveries, uncovering the mysterious worlds beyond Earth. Using the power of Augmented Reality (AR) you will be able to design and explore your own Augmented Reality World unconstrained by physics. Augmented Reality is similar to Virtual Reality, but instead of placing you in a 100% virtual world, AR shows the real world mixed with virtual elements.

Students will investigate the superpowers of the natural world and get inspired to design their own fantasy world & characters. They will uncover fascinating futuristic thinking and utilize the creative process to integrate these features into 3d modeled environments and avatars, ready to be viewed in AR ( Augmented Reality)  

Students will explore the power of illustration, storytelling, and digital design  3D modeling). Students will then learn rapid prototyping tools and how to bring their projects to the virtual world, thus introducing them to the exciting world of Augmented reality and Virtual Reality experience.


مرحبًا بك في كوكب الواثع المعزز حيث يمكنك تحويل المساحات اليومية إلى عالم جديد تمامًا من الاكتشافات ، وكشف العوالم الغامضة خارج الأرض. باستخدام قوة الواقع المعزز ، ستتمكن من تصميم واستكشاف عالم الواقع المعزز الخاص بك غير المقيّد بالفيزياء. يشبه الواقع المعزز الواقع الافتراضي ، ولكن بدلاً من وضعك في عالم افتراضي بنسبة 100٪ ، يُظهر الواقع المعزز العالم الحقيقي ممزوجًا بالعناصر الافتراضية.

في هذا الاستوديو ، ستستخدم محركًا شائعًا للألعاب عبر الأنظمة الأساسية لتطوير ألعاب الفيديو ومنشآت وسائط تفاعلية ، لتصميم عالم معزز مليء بالتحديات الافتراضية التي تضعك في قلب الحدث من خلال هاتفك الخلوي. تخيل رؤية المجرات في السماء وأنت تمشي إلى المدرسة ، وتخرج من مخلوقات العالم هذه ، وتجد بوابات مخفية إلى بُعد آخر في الأزقة. استعد لاستخدام إبداعك لتطوير عوالم تنقلك إلى عالم لا حدود له!


Focus Skills/Subjects/Technologies: 



Coding
Design
Storytelling
Game Design
Interactions Design
AR Software