{"id":38529686,"url":"https://github.com/akkana/threeworlds","last_synced_at":"2026-01-17T06:53:27.942Z","repository":{"id":145221917,"uuid":"368559460","full_name":"akkana/threeworlds","owner":"akkana","description":"Experiments with displaying Earth (and maybe other planets) in 3D using three.js","archived":false,"fork":false,"pushed_at":"2021-06-18T01:25:39.000Z","size":1683,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-01-27T20:41:32.978Z","etag":null,"topics":["earth","globe","javascript","webapps"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akkana.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}},"created_at":"2021-05-18T14:25:24.000Z","updated_at":"2021-06-28T13:21:24.000Z","dependencies_parsed_at":"2023-11-12T02:45:44.197Z","dependency_job_id":null,"html_url":"https://github.com/akkana/threeworlds","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"7ddaca5f8d7fea482cd91fbcebdd0a20c3bcc93f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akkana/threeworlds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkana%2Fthreeworlds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkana%2Fthreeworlds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkana%2Fthreeworlds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkana%2Fthreeworlds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akkana","download_url":"https://codeload.github.com/akkana/threeworlds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkana%2Fthreeworlds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["earth","globe","javascript","webapps"],"created_at":"2026-01-17T06:53:27.289Z","updated_at":"2026-01-17T06:53:27.931Z","avatar_url":"https://github.com/akkana.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ThreeWorlds\n\nFiddling with displaying Earth, and maybe other planets, in\nvarious ways in [Three.js](https://threejs.org).\n\nThe original goal was to show a 3-D model of Earth and show\nhow the terminator progresses over the course of a day from sunrise\nto sunset, and also how the angle of the terminator changes between\nsolstices and equinoxes, to help in visualizing the effect of\nthe changing sun angle over the seasons.\n\nThese are experiments, not polished webapps ready to deploy.\nSome examples have values hardcoded into them. I wrote most of these\nwhile preparing a talk for the Los Alamos Nature Center about the\nsummer solstice, so you may see latitude and longitude for the nature\ncenter, or for the subsolar point at various times of day during\nthe northern hemisphere summer solstice.\n\n## Dependency\n\nSome of these examples use suncalc.js, available from my\n[webapps/analemma](https://github.com/akkana/webapps/blob/master/analemma/js/suncalc.js)\nproject. They will look for it in ```/javascript/suncalc.js```.\n\n## View the Examples, Live\n\nYou can view some of the examples live on\n\u003ca href=\"https://akkana.github.io/threeworlds/\"\u003eThreeWorlds\non GitHub Pages\u003c/a\u003e.\n\n## Running the Examples\n\nDepending on your browser permissions, you may or may not be able to\nload an example simply by loading its *index.html* file. The way\nI run them is to make a symbolic link to the threeworlds top-level\ndirectory into the directory my local apache2 installation uses,\nthen visit http://localhost/threeworlds/ and navigate from there.\n\nIf you don't normally run a web server on your local machine,\nyou can run a minimal one; for instance, in Python 3,\nchange directory to threeworlds and run ```python3 -m http.server```\nafter which you can navigate to http://0.0.0.0:8000/ .\n\n## multiimages-cgi and python\n\nMy first approach was to use Python and PyEphem to generate a static\nrectangular day/night image (see *python/daynightimage.py*),\nthen view it by borrowing some code from my\n[MarsMap} in [webapps](https://github.com/akkana/threeworlds)\nweb app (see the [live MarsMap page](https://shallowsky.com/marsmap/))\nto wrap the image around a globe (because, sadly, there's no Python\nlibrary remotely similar to Three.js). You'll find that code\nin *multiimages-cgi*.\n\nBut you need to generate a lot of static images to really explore\nEarth's motion that way, which takes a lot of time and disk space,\nso I wanted to see if I could do the same thing all in Three.js.\n(I'd still want Python for calculating times of things like sunrise\nand sunset, solstices and equinoxes,\nthough [astro.js](http://slowe.github.io/astro.js/)\nlooks interesting, while Python has at least three good options.)\n\n## directional-light\n\nThe most obvious approach is to render Earth, calculate the direction\nof the sun, and define an AmbientLight from that direction, which\nis what the *directional-light* example does. That works fine,\nbut it loses the pretty \"Black Marble\" image of Earth at night\nthat the Python script used.\n\n## daynightglobe and daynight-clipping\n\nOne approach to getting the \"black marble\" imagery back is to render\ntwo layers on the globe: one for daytime Earth, one for nighttime.\nThe best example of using two layers on the same sphere was in the\n[gist by marcopompili](https://gist.github.com/marcopompili/082a159fcfc7c349771d10cbe991fb5d)\nthat uses a cloud layer on top of several Earth layers.\n*daynightglobe* retains some of the structure of marcopompili's gist,\nbut I found myself getting crossed up trying to extend it,\nand I couldn't seem to make it work without TrackballControls.js\neven though I wasn't using any of those controls,\nand I ended up simplifying it a bit (though also losing the nice\nclass structure) in *daynight-clipping*.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkana%2Fthreeworlds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakkana%2Fthreeworlds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkana%2Fthreeworlds/lists"}