🌎 Realistic 3D earth model powered by ThreeJs library. Easy to use and integrate in your next 3D project.
- ThreeJs library is used to make 3D Earth model.
- Layout is created using HTML5.
World
folder contains the files for model- World component can be integrated in any application
threejs
library is imported using CDN links
- Import
World
class fromWorld.js
file located inWorld
component
import { World } from './World/World.js';
- Create new instance of world class
const container = document.getElementById('scene-container'); // div element for model in html file
const world = new World(container);
- If your component is not in
src
folder change assets path inEarth
,Space
andMoon
component
- Earth in model is assumed to be Spherical in shape rather than Elliptical
- Geolocation is done using
latitude
andlongitude
of location - See how to convert latitude and longitude into 3D coordinate Spherical Coordinate
world.findLocation(latitude, longitude);
- If latitude is degree North use
positive
otherwisenegative
- If longitude is degree East use
positive
otherwisenegative
India (20.5937° N, 78.9629° E) -> (20.5937, 78.9629)
Brazil (14.2350° S, 51.9253° W) -> (- 14.2350, -51.9253)
Australia (25.2744° S, 133.7751° E) -> (-25.2744, 133.7751)
Star the repository. 🌟
Also, Follow me on GitHub for my next creations! 😎
Designed and developed by 2021 (Kalash Sharma)
Licensed under the MIT License, (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.