mark-lg.celx
上传用户:center1979
上传日期:2022-07-26
资源大小:50633k
文件大小:1k
源码类别:

OpenGL

开发平台:

Visual C++

  1. -- Title: Mark Local Group Galaxies
  2. function mark_LG_galaxies()
  3. --
  4. -- tables with the member galaxies of the Local Group
  5. --
  6. local LG_big_galaxies = {"Milky Way", "M 31", "M 33"}
  7. local LG_members = {"LMC","SMC","IC 10","NGC 6822","M 32","M 110","NGC 3109","NGC 185","IC 1613","NGC 147","Sextans A","Sextans B","WLM","Sagittarius dSph","Fornax dSph","Pegasus DIG","And VII","Leo I","Leo A","And II","And I","And VI","Sagittarius DIG","Aquarius Dwarf","Antlia Dwarf","Sculptor dSph","And III","Leo II","Cetus Dwarf","Sextans dSph","Phoenix Dwarf","LGS 3","Tucana Dwarf","Carina Dwarf","And V","UrsaMinor Dwarf","Draco Dwarf"}
  8. for dso in celestia:dsos() do
  9. for i,v in ipairs(LG_big_galaxies) do
  10.       if dso:name() == v then
  11.          dso:mark( "green", "disk",10, 1 )
  12. end
  13. end
  14. for j,w in ipairs(LG_members) do
  15.    if dso:name() == w then
  16.           dso:mark( "red", "disk",5, 0.7 )
  17.    end
  18. end
  19. end
  20. end
  21. ----------
  22. -- main -- 
  23. ----------
  24. celestia:unmarkall()
  25. celestia:setrenderflags { markers = true }
  26. km2Mpc = 1/3.08568025e19
  27. MW = celestia:find("Milky Way")
  28. celestia:select(MW)
  29. --
  30. -- move observer to a distance of 5 Mpc from Milky Way
  31. --
  32. observer = celestia:getobserver()
  33. observer:gotodistance(MW, 5/km2Mpc,5)
  34. mark_LG_galaxies()
  35. wait(0)