UNPKG

wonder.js

Version:
67 lines (42 loc) 2.03 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>cube</title> </head> <body> <script src="../../test/e2e/js/AssetTool.js"></script> <script src="../../test/e2e/js/LightBoxesTool.js"></script> <script src="../../test/e2e/js/PositionTool.js"></script> <script src="../../test/e2e/js/LightTool.js"></script> <script src="../../test/e2e/js/CameraTool.js"></script> <script src="../../test/e2e/js/LightMaterialTool.js"></script> <script src="../../dist/wd.js"></script> <script> window.onload = function () { return AssetTool.loadConfig(["../config/setting.json", "../config/"], null, function () { return initSample(wd.unsafeGetState()); }); function initSample(state) { var [state, box] = LightBoxesTool.createBox(state); var state = wd.setAmbientLightColor([0.2, 0.2, 0.2], state); var [state, directionLightGameObject] = LightTool.createDirectionLight(state); var transform = wd.unsafeGetGameObjectTransformComponent(directionLightGameObject, state); var state = wd.setTransformLocalEulerAngles(transform, [0, 180, 0], state); var [state, cameraGameObject] = LightBoxesTool.createCamera(state); var [state, cameraController] = wd.createArcballCameraController(state); var state = wd.setArcballCameraControllerDistance(cameraController, 50, state); var state = wd.setArcballCameraControllerWheelSpeed(cameraController, 1, state); var state = wd.addGameObjectArcballCameraControllerComponent(cameraGameObject, cameraController, state); var state = wd.bindArcballCameraControllerEvent( cameraController, state ); wd.startDirector(state); } }; </script> </body> </html>