<?php /* Common bootstrap for examples */ include dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'examples-bootstrap.php'; /* $aframe->scene(); === Anonymous scene */ $aframe->scene()->title('Hello, World! • A-Frame'); $aframe->scene()->description('Hello, World! • A-Frame'); /* sphere method creates anonymous entity matching primitive sphere */ $aframe->scene()->sphere()->position(0, 1.25, -1)->radius(1.25)->color('#EF2D5E'); /* box method creates anonymous entity matching primitive box */ $aframe->scene()->box()->position(-1, 0.5, 1)->rotation(0, 45, 0)->width(1)->height(1)->depth(1)->color('#4CC3D9'); /* cylinder method creates anonymous entity matching primitive cylinder */ $aframe->scene()->cylinder()->position(1, 0.75, 1)->radius(0.5)->height(1.5)->color('#FFC65D'); /* plane method creates anonymous entity matching primitive plane */ $aframe->scene()->plane()->rotation(-90, 0, 0)->width(4)->height(4)->color('#7BC8A4'); /* sky method creates anonymous entity matching primitive sky */ $aframe->scene()->sky()->color('#000'); /* Render scene */ $aframe->scene()->render(); /* DEV: Save output for testsuites */ save_output_files($aframe, '/aframe-io/boilerplate/hello-world');
$aframe->scene()->entity('schematic-1')->child()->image(1)->mixin('image')->src('#schematic2')->scale(0.7, 0.7, 0.7)->animation()->attribute('visible')->from('false')->to('true')->delay(1200)->dur(1)->fill('both'); $aframe->scene()->entity('schematic-1')->child()->image(2)->mixin('image')->src('#text1')->scale(0.2, 0.2, 0.2)->position(2, 0, 0.02)->animation()->attribute('visible')->from('false')->to('true')->delay(1200)->dur(1)->fill('both'); $aframe->scene()->entity('schematic-1')->child()->image(3)->mixin('image')->src('#text3')->scale(0.4, 0.4, 0.4)->position(-1, 1, 0.01)->animation()->attribute('visible')->from('false')->to('true')->delay(1200)->dur(1)->fill('both'); /* rings-group-3 */ $aframe->scene()->entity('rings-group-3')->position(0, 0, -2)->scale(0.5, 0.5, 0.5); $aframe->scene()->entity('rings-group-3')->child()->image(1)->mixin('image')->src('#ring3')->scale(0.8, 0.8, 0.8)->animation()->attribute('visible')->from('false')->to('true')->delay(1000)->dur(1)->fill('both'); $aframe->scene()->entity('rings-group-3')->child()->image(2)->mixin('image')->src('#ring5')->scale(0.9, 0.9, 0.9)->position(0, 0, 0.01)->animation()->attribute('visible')->from('false')->to('true')->delay(1100)->dur(1)->fill('both'); $aframe->scene()->entity('rings-group-3')->child()->image(3)->mixin('image')->src('#ring3')->position(0, 0, 0.02)->animation(1)->attribute('visible')->from('false')->to('true')->delay(1100)->dur(1)->fill('both'); $aframe->scene()->entity('rings-group-3')->child()->image(3)->animation(2)->attribute('scale')->from('1 1 1')->to('1.2 1.2 1.2')->delay(1100)->dur(250)->fill('both')->easing('ease-out'); /* rings-group-2 */ $aframe->scene()->entity('rings-group-2')->position(0, 0, -1)->scale(0.5, 0.5, 0.5); $aframe->scene()->entity('rings-group-2')->child()->image(1)->mixin('image')->src('#ring2')->scale(1.2, 1.2, 1.2)->position(0, 0, 0.01)->animation()->attribute('visible')->from('false')->to('true')->delay(800)->dur(1)->fill('both'); $aframe->scene()->entity('rings-group-2')->child()->image(2)->mixin('image')->src('#text1')->scale(0.3, 0.3, 0.3)->position(0, 0, 0.02)->animation()->attribute('visible')->from('false')->to('true')->delay(900)->dur(1)->fill('both'); /* rings-group-1 */ $aframe->scene()->entity('rings-group-1')->scale(0.6, 0.6, 0.6); $aframe->scene()->entity('rings-group-1')->child()->image(1)->mixin('image')->src('#ring5')->scale(1.2, 1.2, 1.2)->position(0, 0, 0)->animation()->attribute('visible')->from('false')->to('true')->delay(600)->dur(1)->fill('both'); $aframe->scene()->entity('rings-group-1')->child()->image(2)->mixin('image')->src('#ring4')->scale(1.2, 1.2, 1.2)->position(0, 0, 0.01)->animation()->attribute('visible')->from('false')->to('true')->delay(600)->dur(1)->fill('both'); $aframe->scene()->entity('rings-group-1')->child()->image(3)->mixin('image')->src('#ring3')->position(0, 0, 0.02)->animation(1)->attribute('visible')->from('false')->to('true')->delay(700)->dur(1)->fill('both'); $aframe->scene()->entity('rings-group-1')->child()->image(3)->animation(2)->attribute('scale')->from('1 1 1')->to('1.25 1.25 1.25')->delay(700)->dur(250)->fill('both')->easing('ease-out'); /* Lights */ $aframe->scene()->light()->type('point')->color('#94c6ff')->distance(15)->position(0, 0, -12); $aframe->scene()->light()->type('point')->color('#94c6ff')->distance(17)->position(0, 0, -6); $aframe->scene()->light()->type('ambient')->color('#4f6487'); /* Sounds */ $aframe->scene()->entity()->sound()->autoplay(true)->src('audio/321103__nsstudios__blip1.wav'); $aframe->scene()->entity()->sound()->autoplay(true)->src('audio/321104__nsstudios__blip2.wav'); /* Render scene */ $aframe->scene()->render(); /* DEV: Save output for testsuites */ save_output_files($aframe, '/aframe-io/showcase/anime-UI');