test1.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. class Scenario {
  2. /*
  3. * Description: Test scenario for the Amica VRM viewer.
  4. * Version: 0.1
  5. */
  6. constructor(ctx) {
  7. console.log('constructor', ctx);
  8. this.$ = ctx.scope;
  9. this.THREE = ctx.THREE;
  10. }
  11. async setup() {
  12. const $ = this.$;
  13. const THREE = this.THREE;
  14. this.x = new THREE.Vector3(1, 2, 3);
  15. await $.loadVrm(
  16. // 'https://vrm.heyamica.com/file/amica-vrm/82754e287e0b26b5d7a1fd223ed0fd5debcabed81f36549fb2c16b201f3e5ca9',
  17. '/vrm/AvatarSample_A.vrm',
  18. (progress) => {
  19. console.log(`loading model ${progress}`);
  20. },
  21. );
  22. await $.loadRoom(
  23. // 'https://vrm.heyamica.com/file/amica-vrm/e8fc9e2a72e9336dde3635cbdebd0867c4640b72b519dcc5066ba348daac8af5',
  24. // '/room/low_poly_winter_scene.glb',
  25. // new THREE.Vector3(0, 0.2, -2),
  26. // new THREE.Euler(0, 0, 0),
  27. // new THREE.Vector3(0.016, 0.016, 0.016),
  28. // new THREE.Vector3(1, 0, -0.5),
  29. // new THREE.Euler(0, 0, 0),
  30. // new THREE.Vector3(1, 1, 1),
  31. // cafe
  32. // 'https://vrm.heyamica.com/file/amica-vrm/891c084b0831e6c3f1035411ff285aa21b872ce0d29a5986d02907c97d27258a',
  33. // new THREE.Vector3(-1, 0, 1),
  34. // new THREE.Euler(0, 0, 0),
  35. // new THREE.Vector3(1, 1, 1),
  36. // bathroom
  37. 'https://vrm.heyamica.com/file/amica-vrm/3b718af7c9111e0953a161e10fe8867320b17b4bad04759bcf1d3456c6ea7023',
  38. new THREE.Vector3(1.4, -4.75, 1.15),
  39. new THREE.Euler(0, 0, 0),
  40. new THREE.Vector3(0.275, 0.275, 0.275),
  41. (progress) => {
  42. console.log(`loading room ${progress}`);
  43. }
  44. );
  45. }
  46. update(delta) {
  47. // console.log('update', this.x);
  48. }
  49. }