Real Stars ✦ Add 1000 brightest star to your night sky

Real stars

Add 1000* real stars to roblox **(NO SUN)**


Usage

local starcreator = require(script.Parent.Star) 
local database = require(script.Parent.Star.BStr1000)  

starcreator.LoadArr(database,workspace.Part) 
local latitude = 6.63880 --Set latitude
local longtitude = 100.42340 --Set longtitude
local ttz 

while task.wait() do
	ttz=DateTime.now():ToUniversalTime() --Set time to UTC
	year,month,day,hour,minute,second=ttz.Year,ttz.Month,ttz.Day,ttz.Hour,ttz.Minute,ttz.Second--Expand the time
	year,month,day,hour,minute,second=tonumber(year),tonumber(month),tonumber(day),tonumber(hour),tonumber(minute),tonumber(second)--Deprecated, Used for os.time applications
	starcreator.LoadRot(latitude,90+starcreator.calculateLST(longtitude,year,month,day,hour,minute,second)*15+,workspace.Part)--Rotate workspace.part, 
end

This code will create a realistic sky at Sadao, Thailand at any time according to UNIX timestamp


Documentation

A few function you need to use

starcreator.LoadArr(database : Array , Part : Part)

  • Loads stars from a Database array, around a part as attachment at 2000 studs

starcreator.calculateLST(longtitude : degree , year : Number , month : Number , day : Number , hour : Number , minute : Number , second : Number)

  • Calculates the Local Sidereal Time from longtitude and time precisely

  • Returns Local Sidereal Time in Decimal Hour

starcreator.LoadRot(latitude : degree , 90 + LST : degree , Part : Part)

  • Rotate a part to the appropriate rotation given latitude and LST
  • The 90 Degree is to account for initial rotation of the part that has original rotation as 0,0,0 when loadArr is called on the part

Limitations

  • It is accurate but in no way should be used for real world stuff like navigation

  • Verified by checking with Stellarium Which might be incorrect

  • Might not be correct as I am not sure wheture EOT is accounted for in the LST calculations

  • The daytime and Sun is not included right now, So no sun, No daylight and No Moon

  • No fog or atmosphere at all

  • Stars always visible ( Might fix in da future)


Expanding

Check this Github page, This is the code used to create the JSON data string to be used in Real Stars


License

If used in any public project, just add "Using Real Stars by tin_nim" in description

Get it


Notes

  • Only top 1000 brightest (Apparent Magnitude) stars are added
21 Likes

oooo~ I would love to see how this resource expands in the future!

absolutely beautiful, I would love to see how this progresses in the future. I will be using this system in a future project.