{"id":15282465,"url":"https://github.com/dougreeder/aframe-atoll-terrain","last_synced_at":"2025-04-12T23:04:39.902Z","repository":{"id":34796911,"uuid":"175141235","full_name":"DougReeder/aframe-atoll-terrain","owner":"DougReeder","description":"An A-Frame WebVR primitive that has a circle of high-resolution terrain near the origin, surrounded by a low-resolution sea or plain that stretches to the horizon","archived":false,"fork":false,"pushed_at":"2024-08-06T21:49:21.000Z","size":1236,"stargazers_count":7,"open_issues_count":7,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-21T09:45:28.413Z","etag":null,"topics":["landscape","terrain","webvr","webvr-aframe"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/DougReeder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-03-12T05:25:54.000Z","updated_at":"2024-08-06T21:49:24.000Z","dependencies_parsed_at":"2024-10-14T14:20:50.363Z","dependency_job_id":"1b002243-f254-4236-8d87-a144f5d6b584","html_url":"https://github.com/DougReeder/aframe-atoll-terrain","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":"0.19999999999999996","last_synced_commit":"f8d91091db15ef797f272f875a636ee9aa9bac08"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougReeder%2Faframe-atoll-terrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougReeder%2Faframe-atoll-terrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougReeder%2Faframe-atoll-terrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougReeder%2Faframe-atoll-terrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DougReeder","download_url":"https://codeload.github.com/DougReeder/aframe-atoll-terrain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240152188,"owners_count":19756039,"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":["landscape","terrain","webvr","webvr-aframe"],"created_at":"2024-09-30T14:26:19.264Z","updated_at":"2025-02-22T09:31:18.516Z","avatar_url":"https://github.com/DougReeder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"aframe-atoll-terrain\n====================\n\nAn [A-Frame](https://aframe.io) [WebVR](https://webvr.info/) primitive that has a circle of high-resolution terrain near the origin,\nsurrounded by a low-resolution sea or plain that stretches to the horizon.\nOptionally, the high-resolution area can include a central plateau or sea.\n\nUses a grid of equilateral triangles for efficiency.\nUsable on mobile, with moderate detail.\n\nPairs well with [aframe-simple-sun-sky](https://www.npmjs.com/package/aframe-simple-sun-sky)\nor [aframe-sun-sky](https://www.npmjs.com/package/aframe-sun-sky)\n\n![sample screenshot](aframe-atoll-terrain-sample.png)\n\n[live example scene](https://dougreeder.github.io/aframe-atoll-terrain/example.html)\nUse VR controller joystick or touchpad to move around.  On desktop, drag to turn and use WASD keys to move.\nReload several times to see some variations, especially if you don't see water from your initial location.\n\n\nUsage\n---\n\nInclude using \n```html\n\u003cscript src=\"https://unpkg.com/aframe-atoll-terrain@^1.0.0/dist/aframe-atoll-terrain.js\"\u003e\u003c/script\u003e\n```\n\n\nDeclare it as a direct child of the scene (normally):\n```html\n\u003ca-scene\u003e\n    \u003ca-atoll-terrain plateau-radius=\"5\" middle-radius=\"400\" unit-size=\"4\" far=\"4000\"\n                     land-yin-color=\"#528d04\" land-yang-color=\"#278d53\" sea-yin-color=\"#005e85\" sea-yang-color=\"#2571cf\"\n                     sun-position=\"0.8 0.6 0\"\u003e\n    \u003c/a-atoll-terrain\u003e\n    \u003c!-- ... --\u003e\n\u003c/a-scene\u003e\n```\n\n\nParameters \n---\nTypically, you'll leave the entity position and rotation as zero, but you don't have to.\n\n\n### plateau-radius\n* default: 10\n* minimum: 0\n* maximum: middle-radius - 2*unit-size\n\nRadius of the central plateau, in meters.\nIf radius is 0, there is no plateau.\n\n\n### plateau-elevation\n* minimum: 0\n* default: 1\n\nElevation of the plateau.  If zero, forces there to be water in the center of the island.\n\nIf this is zero and `plateau-radius` is a large fraction of `middle-radius`, you'll have a ring-shaped island - an atoll!\n\n\n### elevation-bias\n* default: 0\n\nWhen there is no plateau, this is the elevation of the high-resolution area before noise is applied, in meters.\n\nWhen there is a plateau, the elevation of the high-resolution area is automatically adjusted so the plateau blends in.\nLeave this at zero, unless you want a volcano or an isolated plateau.\n\n\n### plateau-yin-color, plateau-yang-color\n* default: land-yin-color, land-yang-color\n\nValues close to land-yin-color and land-yang-color typically work best.\n\n\n### middle-radius\n* default: 100\n\nRadius of the high-resolution area, in meters.\n\n\n### unit-size\n* default: 1\n\nDistance between vertexes in the high-resolution area, in meters.\n\nWill be adjusted to be a simple fraction of middle-radius, if necessary.\n\n\n### far\n* default: 4000\n* minimum: middle-radius + unit-size\n\nRadius of the low-resolution plain, in meters. \nThus, it's also the distance to the effective horizon. \nShould be about 80% of the radius of your sky sphere.\n\n\n### land-yin-color, land-yang-color\n* defaults: #528d04, #278d53\n\nThe color of the land smoothly varies between these two extremes.\nTypically, you'll want them to vary mostly by hue and saturation, rather than intensity.\nNoise will cause brief excursions outside this range.\n\n\n### sea-yin-color, sea-yang-color\n* defaults: #528d04, #278d53\n\nThe color of the sea smoothly varies between these two extremes.\n\n\n### sun-position\n* default: {x:-1.0, y:1.0, z:-1.0}\n\nThe direction from which the sun is shining.\nThis primitive ignores directional lights.\nIf you're using one of the *-sun-sky primitives, set its sun-position to the same value.\n\n\n### shader\n* default: 'vertex-color+noise'\n\nIf you use a different shader, the colors and sun-position will probably be ignored.\n\n\n### seed\n* default: random\n\nA number greater than zero and less than one, from which the terrain will be randomly generated.\n\n\n### log\n* default: false\n\nWhether to write diagnostic data to the console. \n\n\nExtracting Elevation data\n-------------------------\n\nThe geometry component has a `getElevation` method, which returns the approximate elevation of a point:\n\n```javascript\nconst terrainGeometry = this.el.querySelector('a-atoll-terrain').getAttribute('geometry');\nconst spherePosition = document.querySelector('a-sphere').getAttribute('position');\nspherePosition.y = terrainGeometry.getElevation(spherePosition.x, spherePosition.z) + 1.6;\n```\n\n\nDevelopment\n---\n`npm install`\n\nedit files\n\n`npm run-script build`\n\n\nInternals\n---\nThe geometry component sets vertex colors, so you should probably use a material that uses them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougreeder%2Faframe-atoll-terrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougreeder%2Faframe-atoll-terrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougreeder%2Faframe-atoll-terrain/lists"}