{"id":25940711,"url":"https://github.com/2003scape/rsc-models","last_synced_at":"2025-03-04T05:18:36.957Z","repository":{"id":44756164,"uuid":"456048180","full_name":"2003scape/rsc-models","owner":"2003scape","description":"🫖 (de)serialize runescape classic 3D models","archived":false,"fork":false,"pushed_at":"2022-05-26T00:03:28.000Z","size":1326,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T07:02:32.293Z","etag":null,"topics":["3d","3d-models","blender","jagex","rsc","runescape","wavefront","wavefront-obj"],"latest_commit_sha":null,"homepage":"https://2003scape.github.io/rsc-models","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2003scape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-06T03:41:05.000Z","updated_at":"2025-01-18T20:46:43.000Z","dependencies_parsed_at":"2022-07-16T11:00:41.052Z","dependency_job_id":null,"html_url":"https://github.com/2003scape/rsc-models","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/2003scape%2Frsc-models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2003scape","download_url":"https://codeload.github.com/2003scape/rsc-models/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787647,"owners_count":20020133,"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","3d-models","blender","jagex","rsc","runescape","wavefront","wavefront-obj"],"created_at":"2025-03-04T05:18:36.504Z","updated_at":"2025-03-04T05:18:36.944Z","avatar_url":"https://github.com/2003scape.png","language":"JavaScript","readme":"# rsc-models\n(de)serialize runescape classic 3D model archives to and from\n[wavefront .obj and .mtl](https://en.wikipedia.org/wiki/Wavefront_.obj_file)\nfiles. supports automatic UV unwrapping. works with blender import and export.\nuse [rsc-sprites](https://github.com/2003scape/rsc-sprites) to dump and pack\ntextures.\n\n[three.js model viewer](https://2003scape.github.io/rsc-models)\n\n*models dumped and loaded into blender:*\n\n![altar model](./doc/altar-blender.png)\n![range model](./doc/range-blender.png)\n![fire model](./doc/fire-blender.png)\n![chest model](./doc/chest-blender.png)\n\n\n*models exported from blender and loaded into the game:*\n\n![n64 table model](./doc/n64-game.png)\n![yoshi and gnome trees](./doc/yoshi-gnome-game.png)\n\n## install\n\n    $ npm install @2003scape/rsc-models # -g for CLI program\n\n## cli usage\n```\nrsc-models \u003ccommand\u003e\n\nCommands:\n  rsc-models dump-obj \u003cconfig\u003e \u003carchive\u003e    dump model OBJs from models jag\n                                            archive\n  rsc-models pack-obj \u003cconfig\u003e \u003carchive\u003e    pack model OBJ(s) into models jag\n  \u003cfiles..\u003e                                 archive\n\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n```\n\n    $ rsc-models dump-obj config85.jag models36.jag -o models36-obj/\n    $ rsc-models pack-obj config85.jag models37.jag yoshi.obj n64.obj\n\n## example\n```javascript\nconst fs = require('fs');\nconst { Config } = require('@2003scape/rsc-config');\nconst { Models } = require('@2003scape/rsc-models');\n\nconst config = new Config();\nconfig.loadArchive(fs.readFileSync('./config85.jag'));\n\nconst models = new Models(config);\nmodels.loadArchive(fs.readFileSync('./models36.jag'));\n\n// dumping wavefront\nconst tree = models.getModelByName('tree');\n\nfs.writeFileSync('./tree.obj', tree.getObj());\nfs.writeFileSync('./tree.mtl', tree.getMtl());\n\n// loading external wavefront\nconst yoshi = models.fromWavefront(\n    fs.readFileSync('./yoshi.obj', 'utf8'),\n    fs.readFileSync('./yoshi.mtl', 'utf8')\n);\n\nmodels.setModel('tree', yoshi);\n\nfs.writeFileSync('./models37.jag', models.toArchive());\n```\n\n## api\n### models = new Models({ objects, textures }, extraNames = ANIMATED\\_MODELS)\ncreate a new models (de)serializer instance. extraNames are an array of model\nnames that aren't stored in the config archive's objects cache.\n\n### models.loadArchive(buffer)\nloads a models jag archive buffer.\n\n### model.modelNames\narray of valid model names.\n\n### models.getModels()\nreturn an array of all `Model` instances.\n\n### models.getModelByName(name)\nreturn a `Model` instance by name (defined in\n[rsc-config](https://github.com/2003scape/rsc-config/blob/master/config-json/models.json)).\n\n### models.getModelById(id)\nreturn a `Model` instance based on index of model name.\n\n### models.fromWavefront(objFile, mtlFile)\nreturn a `Model` instance from wavefront .obj and .mtl file strings.\n\n### models.toArchive()\nreturn a models jag archive buffer.\n\n### model = new Model({ textureNames }, { name, vertices, faces }?)\ncreate a new model, either empty or using existing properies.\n\n### model.name\nname of ob3 file to use in archive (without extension).\n\n### model.vertices\narray of `{ x, y, z }` integers.\n\n### model.faces\n```javascript\n[\n    {\n        // front face material\n        fillFront: {\n            i: 1, // illumination, 0 or 1\n            r, g, b, // (0-248) each channel, or\n            texture: textureIndex // from rsc-config\n        } // or null,\n        fillBack: null, // same format as fillFront, or null\n        vertices: [] // array of vertex indexes (defined above)\n    }\n]\n```\n\n### model.updateFillIDs()\niterate through `model.faces` and update materials for .mtl file generation.\n\n### model.getObj()\nreturn model geometry string in wavefront .obj format.\n\n### model.getMtl()\nreturn model materials string in wavefront .mtl format.\n\n### model.toJSON()\nreturn public serializable properties.\n\n### ANIMATED\\_MODELS\narray of hard-coded model names that aren't in config archive.\n\n## model bugs\n\nthe following models have faces with less than three vertices:\n\n * logbridgelow\n * logbridgehigh\n * logbridgecurvedhigh\n * logbridgecurvedlow\n * treeplatformlow2\n * treeplatformhigh2\n * stonestand\n * grand tree-lev 0\n * tribalstature\n * grand tree-lev 1\n * grand tree-lev 2\n * fourwayplatform-lev 0\n * fourwayplatform-lev 1\n * grand tree-lev 3\n * blurberrybar\n * cave snaptrap\n * cave snaptrapa\n * rocksteps\n\nthere are also 25 secret models that are never loaded in the game (hashed):\n\n * 1037362809\n * -1060436729\n * -1115958269\n * -1220733691\n * 1227393374\n * -1263331649\n * 1347842162\n * -1430585029\n * 1512310831\n * 1526156672\n * 1540002513\n * 1657318544\n * 1721021053\n * 2142891767\n * -380606436\n * 515450526\n * 529296367\n * 538300861\n * 550294861\n * 564140702\n * 587507422\n * -669716258\n * -741690938\n * 763644315\n * 846098451\n\n## license\nCopyright 2022  2003Scape Team\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the\nFree Software Foundation, either version 3 of the License, or (at your option)\nany later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along\nwith this program. If not, see http://www.gnu.org/licenses/.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2003scape%2Frsc-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2003scape%2Frsc-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2003scape%2Frsc-models/lists"}