{"id":22427243,"url":"https://github.com/node-3d/node-3d","last_synced_at":"2025-08-01T10:31:52.323Z","repository":{"id":80320724,"uuid":"130956301","full_name":"node-3d/node-3d","owner":"node-3d","description":"Guidlines and common information","archived":false,"fork":false,"pushed_at":"2024-11-22T06:51:05.000Z","size":17090,"stargazers_count":48,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-22T07:28:51.569Z","etag":null,"topics":["2d","2d-graphics","3d","3d-graphics","crossplatform","gl","js","node-3d","nodejs","opengl","webgl"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-3d.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-25T05:43:36.000Z","updated_at":"2024-11-22T06:51:09.000Z","dependencies_parsed_at":"2024-11-22T07:34:55.695Z","dependency_job_id":null,"html_url":"https://github.com/node-3d/node-3d","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/node-3d%2Fnode-3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fnode-3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fnode-3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fnode-3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-3d","download_url":"https://codeload.github.com/node-3d/node-3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228364059,"owners_count":17908319,"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":["2d","2d-graphics","3d","3d-graphics","crossplatform","gl","js","node-3d","nodejs","opengl","webgl"],"created_at":"2024-12-05T20:11:16.197Z","updated_at":"2024-12-05T20:11:17.201Z","avatar_url":"https://github.com/node-3d.png","language":"Shell","readme":"# Node3D\n\n[![NPM](https://badge.fury.io/js/3d-core-raub.svg)](https://badge.fury.io/js/3d-core-raub)\n[![ESLint](https://github.com/node-3d/3d-core-raub/actions/workflows/eslint.yml/badge.svg)](https://github.com/node-3d/3d-core-raub/actions/workflows/eslint.yml)\n[![Test](https://github.com/node-3d/3d-core-raub/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/3d-core-raub/actions/workflows/test.yml)\n\n```console\nnpm i -s 3d-core-raub\n```\n\n![Node3D](https://github.com/node-3d/node-3d/raw/master/logo/front/logo.png)\n\n\n## Desktop 3D applications with **Node.js** and **OpenGL**.\n\n* **WebGL**-like interface. Real OpenGL though.\n* **Three.js** compatible environment.\n* Use node modules and compiled addons: CUDA, OpenCL, etc.\n* Window control. Multiwindow applications.\n* Read/write files.\n* Crossplatform: Linux x64, Linux ARM, MacOS x64, Windows x64.\n\n![Example](https://github.com/node-3d/3d-core-raub/raw/4.1.0/examples/screenshot.png)\n\nCompatibility with **three.js** allows porting the existing JS code.\nThe real OpenGL backend is used (not ANGLE). So it is possible to use the GL resource IDs\nto setup interoperation with CUDA or OpenCL. This is the most important feature of this\nproject and why it was created in the first place.\n\nIt is quite possible to create a fully-features apps and games using this framework.\nFor example, see\n[Space Simulation Toolkit](https://store.steampowered.com/app/1196080/Space_Simulation_Toolkit/).\n\n\n## Quick start\n\n1. Setup the project directory:\n\n\t```console\n\tmkdir my-project\n\tcd my-project\n\tnpm init -y\n\tnpm i -s 3d-core-raub three\n\ttouch index.js\n\t```\n\n1. Paste the code and see if it works:\n\n\t```javascript\n\t// Init Node3D environment\n\tconst three = require('three');\n\tconst { init, addThreeHelpers } = require('3d-core-raub');\n\tconst { doc, gl, requestAnimationFrame } = init({ isGles3: true, isWebGL2: true, vsync: false });\n\taddThreeHelpers(three, gl);\n\t\n\t// Three.js rendering setup\n\tconst renderer = new three.WebGLRenderer();\n\tconst scene = new three.Scene();\n\tconst camera = new three.PerspectiveCamera(70, doc.w / doc.h, 0.2, 500);\n\tcamera.position.z = 35;\n\tscene.background = new three.Color(0x333333);\n\t\n\t// Add scene lights\n\tscene.add(new three.AmbientLight(0xc1c1c1, 0.5));\n\tconst sun = new three.DirectionalLight(0xffffff, 2);\n\tsun.position.set(-1, 0.5, 1);\n\tscene.add(sun);\n\t\n\t// Original knot mesh\n\tconst knotGeometry = new three.TorusKnotGeometry(10, 1.85, 256, 20, 2, 7);\n\tconst knotMaterial = new three.MeshToonMaterial({ color: 0x6cc24a });\n\tconst knotMesh = new three.Mesh(knotGeometry, knotMaterial);\n\tscene.add(knotMesh);\n\t\n\t// A slightly larger knot mesh, inside-out black - for outline\n\tconst outlineGeometry = new three.TorusKnotGeometry(10, 2, 256, 20, 2, 7);\n\tconst outlineMaterial = new three.MeshBasicMaterial({ color: 0, side: three.BackSide });;\n\tconst outlineMesh = new three.Mesh(outlineGeometry, outlineMaterial);\n\tknotMesh.add(outlineMesh);\n\t\n\t// Handle window resizing\n\tdoc.addEventListener('resize', () =\u003e {\n\t\tcamera.aspect = doc.w / doc.h;\n\t\tcamera.updateProjectionMatrix();\n\t\trenderer.setSize(doc.w, doc.h);\n\t});\n\t\n\t// Called repeatedly to render new frames\n\tconst animate = () =\u003e {\n\t\trequestAnimationFrame(animate);\n\t\tconst time = Date.now();\n\t\tknotMesh.rotation.x = time * 0.0005;\n\t\tknotMesh.rotation.y = time * 0.001;\n\t\trenderer.render(scene, camera);\n\t};\n\t\n\tanimate();\n\t```\n\n1. See docs and examples: [3d-core-raub](https://github.com/raub/node-3d-core).\n\n1. Take a look at Three.js [examples](https://threejs.org/examples/).\n\n\n## Node3D Modules\n\n1. **Core** - key components to run WebGL code on Node.js.\n\t* [3d-core-raub](https://github.com/node-3d/3d-core-raub) -\n\t3D Core, this is just enough for Node3D to work.\n\t* [addon-tools-raub](https://github.com/node-3d/addon-tools-raub) -\n\thelpers for Node.js addons.\n\t* [glfw-raub](https://github.com/node-3d/glfw-raub) -\n\tnative window control, can mimic web Document/Window/Canvas.\n\t* [image-raub](https://github.com/node-3d/image-raub) -\n\timage loading, can mimic web\n\t[Image](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image).\n\t* [segfault-raub](https://github.com/node-3d/segfault-raub) -\n\tcatches and logs the C++ crash messages: segmentation fault, etc.\n\t* [webgl-raub](https://github.com/node-3d/webgl-raub) -\n\ta [WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API)\n\timplementation.\n\n1. **Dependency** - carries one or more precompiled binary and/or C++ headers.\n\t* [deps-bullet-raub](https://github.com/node-3d/deps-bullet-raub) -\n\t[Bullet Physics](https://pybullet.org/wordpress/) binaries and headers.\n\t* [deps-freeimage-raub](https://github.com/node-3d/deps-freeimage-raub) -\n\t[FreeImage](http://freeimage.sourceforge.net/) binaries and headers.\n\t* [deps-labsound-raub](https://github.com/node-3d/deps-labsound-raub) -\n\t[LabSound](https://github.com/LabSound/LabSound) binaries and headers.\n\t* [deps-opengl-raub](https://github.com/node-3d/deps-opengl-raub) -\n\t[OpenGL](https://www.opengl.org/), [GLFW](https://www.glfw.org/),\n\t[GLEW](http://glew.sourceforge.net/) binaries and headers.\n\t* [deps-qmlui-raub](https://github.com/node-3d/deps-qmlui-raub) -\n\tQmlUi binaries and headers.\n\t* [deps-qt-core-raub](https://github.com/node-3d/deps-qt-core-raub) -\n\tQt binaries for console apps.\n\t* [deps-qt-gui-raub](https://github.com/node-3d/deps-qt-gui-raub) -\n\tQt binaries for GUI apps.\n\t* [deps-qt-qml-raub](https://github.com/node-3d/deps-qt-qml-raub) -\n\tQt binaries for QML apps.\n\t* [deps-uiohook-raub](https://github.com/node-3d/deps-uiohook-raub) -\n\tbinaries and headers to use [libuiohook](https://github.com/kwhat/libuiohook) with NPM.\n\n1. **Addon** - provides native bindings.\n\t* [bullet-raub](https://github.com/node-3d/bullet-raub) -\n\trigid-body subset of Bullet Physics.\n\t* [cuda-raub](https://github.com/node-3d/cuda-raub) -\n\taddon for running NVidia CUDA programs on GPU.\n\t* [opencl-raub](https://github.com/node-3d/opencl-raub) -\n\taddon for running OpenCL programs on GPU.\n\t* [qml-raub](https://github.com/node-3d/qml-raub) -\n\tNode3D-QML interoperation.\n\t* [webaudio-raub](https://github.com/node-3d/webaudio-raub) -\n\ta [WebAudio](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API)\n\timplementation.\n\n1. **Plugin** - a high-level **Node3D** module designed to seamlessly use the addons\ntogether with 3d-core. A plugin uses 3d-core context and primitives to provide additional\nfeatures that combine **Node3D** envitonment and whatever addon(s) the plugin wraps.\n\n\tFor example:\n\n\t```javascript\n\timport { dirname } from 'node:path';\n\timport { fileURLToPath } from 'node:url';\n\timport * as three from 'three';\n\timport { init, addThreeHelpers } from '3d-core-raub';\n\timport { init as initQml } from '3d-qml-raub';\n\n\tconst __dirname = dirname(fileURLToPath(import.meta.url));\n\tconst {\n\t\tdoc, Image: Img, gl,\n\t} = init({ isGles3: true, isWebGL2: true });\n\taddThreeHelpers(three, gl);\n\tconst { QmlOverlay, loop } = initQml({ doc, gl, cwd: __dirname, three });\n\t\n\t// ...\n\tconst overlay = new QmlOverlay({ file: `${__dirname}/qml/gui.qml` });\n\tscene.add(overlay.mesh);\n\t```\n\n\t* [3d-bullet-raub](https://github.com/node-3d/3d-bullet-raub) -\n\textends 3D Core with Bullet Physics.\n\t* [3d-qml-raub](https://github.com/node-3d/3d-qml-raub) -\n\textends 3D Core with QML graphics.\n\t* [3d-webaudio-raub](https://github.com/node-3d/3d-webaudio-raub) -\n\textends 3D Core with an audio interface.\n\n\n## Contributing to Node3D\n\nBugs and enhancements are tracked as\n[GitHub issues](https://github.com/node-3d/node-3d/issues).\nYou can also create an issue on a specific repository of\n[Node3D]((https://github.com/node-3d)).\n\n\n### Issues\n\n* Use a clear and descriptive title.\n* Describe the desired enhancement / problem.\n* Provide examples to demonstrate the issue.\n* If the problem involves a crash, provide its trace log.\n\n\n### Pull Requests\n\n* Do not include issue numbers in the PR title.\n* Commits use the present tense (\"Add feature\" not \"Added feature\").\n* Commits use the imperative mood (\"Move cursor to...\" not \"Moves cursor to...\").\n* File System\n\t* Only lowercase in file/directory names.\n\t* Words are separated with dashes.\n\t* If there is an empty directory to be kept, place an empty **.keep** file inside.\n\n\n## License\n\n**Node3D can be used commercially. You don't have to pay for Node3D or\nany of its third-party libraries.**\n\n**Node3D** modules have their own code licensed under **MIT**, meaning\n\"I've just put it here, do what you want, have fun\". Some\nmodules have **separately licensed third-party software** in them. For instance,\n`deps-freeimage-raub` carries the **FreeImage**\nbinaries and headers, and those are the property of their respective owners,\nand are licensed under **FIPL** terms (but free to use anyway).\n\nAll such cases are explained in `README.md` per project in question.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2Fnode-3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-3d%2Fnode-3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2Fnode-3d/lists"}