{"id":13725905,"url":"https://github.com/webprofusion/dojo3d","last_synced_at":"2025-04-12T03:22:22.932Z","repository":{"id":52309809,"uuid":"307282698","full_name":"webprofusion/dojo3d","owner":"webprofusion","description":"A javascript library for simple 3D interactive story telling,","archived":false,"fork":false,"pushed_at":"2020-11-12T09:11:39.000Z","size":1263,"stargazers_count":124,"open_issues_count":1,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-25T22:51:28.853Z","etag":null,"topics":["3d","coderdojo","coding-dojo","javascript","threejs"],"latest_commit_sha":null,"homepage":"https://dojo3d.webprofusion.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webprofusion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-26T06:41:19.000Z","updated_at":"2024-01-04T16:51:44.000Z","dependencies_parsed_at":"2022-08-27T05:41:21.255Z","dependency_job_id":null,"html_url":"https://github.com/webprofusion/dojo3d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webprofusion%2Fdojo3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webprofusion%2Fdojo3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webprofusion%2Fdojo3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webprofusion%2Fdojo3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webprofusion","download_url":"https://codeload.github.com/webprofusion/dojo3d/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248510546,"owners_count":21116219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","coderdojo","coding-dojo","javascript","threejs"],"created_at":"2024-08-03T01:02:40.432Z","updated_at":"2025-04-12T03:22:22.908Z","avatar_url":"https://github.com/webprofusion.png","language":"TypeScript","readme":"# Dojo3D\n\nAn all-in-one library for 3D story telling, aimed at all ages of coder. No software installation required, useful for CoderDojo, Hour of Code activities etc.\n\n![Example](docs/screens/halloween.png)\n\n# Example Library Usage\n\nSee the Happy Halloween example https://repl.it/@webprofusionchr/dojo3d-halloween\n\nJump straight to `Our main code for a simple story` to see the main story code.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\" /\u003e\n    \u003ctitle\u003eDojo 3D - Example Story Book\u003c/title\u003e\n    \u003cscript src=\"https://dojo3d.webprofusion.com/v1/dojo3d.js\"\u003e\u003c/script\u003e\n    \u003clink\n      rel=\"stylesheet\"\n      href=\"https://dojo3d.webprofusion.com/v1/dojo3d.css\"\n    /\u003e\n  \u003c/head\u003e\n\n  \u003cbody\u003e\n    \u003cscript\u003e\n      // create world\n      var world = new dojo3d.World();\n      var ui = dojo3d.UI;\n\n      //fetch 3d models we can use, then do our main code\n      world.fetchPrefabModels().then(async () =\u003e {\n        // get the Happy Halloween scene model, add it to the scene at scale 0.1\n        // https://sketchfab.com/JessSwynn; License: Creative Commons Attribution\n        var scene = world.getPrefabModelByName(\"Happy Halloween\");\n        obj = await world.addSceneObject(scene, 0.1);\n\n        //turn some lights on\n        world.addLights();\n\n        // define camera viewpoints so we can use them later\n        var viewpoints = [\n          { title: \"ZoomedOut\", position: { x: 0.0, y: 0.0, z: 5.0 } },\n          { title: \"House\", position: { x: 0.059, y: 0.255, z: 1.099 } },\n          { title: \"Spider\", position: { x: 0.05, y: 0.58, z: 0.424 } },\n          { title: \"BackHouse\", position: { x: 0.041, y: 0.463, z: -1.731 } },\n          {\n            title: \"BackUpstairs\",\n            position: { x: -0.066, y: 0.567, z: -0.438 },\n          },\n          { title: \"Ghost\", position: { x: -0.139, y: 0.142, z: -0.466 } },\n          { title: \"RIP\", position: { x: -0.216, y: 0.005, z: 0.57 } },\n          { title: \"Cat\", position: { x: -0.028, y: -0.071, z: 0.826 } },\n        ];\n\n        world.setViewpoints(viewpoints);\n\n        /////////////////////////////////////////\n        // Our main code for a simple story\n        // animate to viewpoint named \"ZoomedOut\"\n        await world.animateToViewpoint(\"ZoomedOut\");\n\n        // show intro message box at x:10,y:10\n        ui.showMessage(\"Hello..\", 10, 10);\n\n        //wait a few seconds\n        await ui.wait(3);\n\n        // ask a question, answer will be \"The option value\", and answer.optionNumber is the option number selected starting at 1 (1,2,3 etc).\n        let answer = await ui.ask(\"Why are your here?\", [\n          \"I don't know.\",\n          \"You sent for me.\",\n        ]);\n\n        if (answer.optionNumber == 1) {\n          ui.showMessage(\"Hmm, lost are we..\");\n        } else {\n          ui.showMessage(\"Hmm, I don't remember doing that..\");\n        }\n\n        // animate to viewpoint named \"ZoomedOut\"\n        await world.animateToViewpoint(\"Cat\");\n      });\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n# Other Examples\n\n[Low Poly Terrain Scene](https://repl.it/@webprofusionchr/amongyou)\n![Among You](docs/screens/amongyou.png)\n\n# Building/testing the library from source\n\n- delete build folder\n\n- `npx rollup -w -c rollup.config.js`\n\n- `npx http-server ` (localhost:8080/src/examples)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebprofusion%2Fdojo3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebprofusion%2Fdojo3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebprofusion%2Fdojo3d/lists"}