Skip to content

A Satellite Tracker powered by ThreeJS. Write with Nextjs 14.

License

Notifications You must be signed in to change notification settings

qianyouliang/satellite-tracker

 
 

Repository files navigation

Satellite Tracker

Powered by THREE.js, Next.js 14, with blazing fast speed (sort of...) 😎

CleanShot 2024-12-12 at 11 35 56

CleanShot 2024-12-12 at 11 35 27

Overview

In action

This is a small project when I am working on my Lab Project, which is making a satellite tracker to be displayed on a big screen. This project was inspired by satellite tracker 3d which definitely need to check out because it is so cool.

How to play

There is a panel on top right, which has trackSat option. Set it to -1 to disable tracking. Set to a number like from 0-9 would focus on a sat. The number is referred to the satellite index you're gonna to track, which is fetch by fetchTles(10). Pass the amount of the satellite you want to fetch.

There is useEdgeEarth option, which toggle whether to use the cool edges earth of just normal earth.

Approach

Firstly it use fetchTles() to fetch tle data online. Then it is pass to calculateBatchTlePositions() to get the actual xyz position for rendering. Also, this function is using Next.js cache feature, and it is running on the server side, so all the calculation is not happening on the user client.

There is a function call geoToCartesian() is worth mentioning. It used to convert geolocation to xyz position. So basically you could add anything to the globe by using this function.

About the edges earth. Firstly, credit to Robot Bobby, go check out his YouTube threejs tutorial, which is excellent. And the land GeoJson data is coming from Natural Earth. All the boundary drawing on the map is done by this lib ThreeGeoJSON.

So I thought it was pretty good to keep it as it if it could help somebody.

Features

  • Fully controlled: No third party library, just pure THREE.js.
  • Cached Sat Data: The satellite data is cached in the server, so it will not be calculated every time the page is loaded.
  • Controllable line thickness: You can control the line thickness of the satellite orbit.

TODO

  • Use Point cloud to render the satellite instead of using a sphere.
  • Add interactive control to the satellite.

地图中出现的中国边界资料收集自互联网

About

A Satellite Tracker powered by ThreeJS. Write with Nextjs 14.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 79.3%
  • JavaScript 17.2%
  • CSS 3.5%