View Full Version : Real 3D Stars

10-16-2008, 04:43 PM
I downloaded 370,000+ star coordinate data from the Tycho-2 Catalog Database (http://data.bao.ac.cn/viz-bin/VizieR?-source=I/280A) in semi-colon separated values format... about 24 megs worth of data. I only selected RightAscension (deg), DEClincation (deg), Parallax (milliarcseconds), Vmagnitude, and Spectral Index fields. "Duplicate" columns for RA and DEC were delivered as well. Since Excel can only read in 65K lines, I had to first split up the file into 50K line chunks and doing a Find of the semi-colons and replacing with commas using EditPad Lite, a great replacement for Notepad. Then I deleted the extra columns in Excel and recombined the files back into a new 370K line text file (copy/paste into a new doc).

OK... database ready. Next, I fed it into my RealStarsGenerator lscript that I wrote 3 years ago and over the last few days fixed up some bugs, input formatting, and interface cleanup... now it's version 1.5.

The script churned out a 15 meg LWO of 370,000+ single point polys, separated into 7 layers according to apparent magnitude, with each star colored with a vmap.

Into Layout it goes and with the Advanced Camera set to HFOV = Cylindrical at 360 deg. a nice 3000 x 1500 pixel spherical image emerged from the renderer (AA = 2, OS = 1.0) in 9.5 min.

To augment the band of the Milky Way, I found a nice 360 deg. Hammer projection image mosaic of our night sky photographed by Alex Mellinger. (http://home.arcor-online.de/axel.mellinger/mwpan_aitoff.html)

In Photoshop I used Flaming Pear's Flexify 2 to convert the image to equirectangular spherical projection, sized it up to fit my rendered star image, and screened it over it with a layer mask to mask out the extraneous photographic stars, then lowered opacity to taste.

Images, object/scene, and script available below for whatever purpose you care to use. Just want to give back to the community that is always every present and helpful to me.


[True 3D/Volumetric 370K Star LWO and Scene] (http://chrusion.com/public_files/tycho/RealStars_370K_Tycho2.zip) - 7.5 megs

[Real 3D Stars Generator Lscript] (http://chrusion.com/public_files/tycho/Real3dStarGen15.zip) - 6K

[Tycho-2 CSV file of 370,000+ stars] (http://chrusion.com/public_files/tycho/Tycho2_370K_csv.zip) - 5 megs

[3000x1500 PNG image with Milkyway] (http://chrusion.com/public_files/tycho/Stars_Tycho2+Milkyway_3000.png) - 5.6 megs

[3000x1500 PNG image without Milkyway] (http://chrusion.com/public_files/tycho/Stars_Tycho2_3000.png) - 5.1 megs

10-16-2008, 04:58 PM
wow really NICE ....


A big fan of your script, tinker with it all the time....

10-16-2008, 06:00 PM
one little observation, when I run the script, you point the script to the .csv file, can you put the code in so it remembers the next time you run the script, i would do it but i do not know how to, yet, still learning the Lscript...

10-16-2008, 08:13 PM
Is this Mac compatible? If so, where do I put this in my script files?

10-16-2008, 09:15 PM
Re. path memory... I'll look into it. Not unless some one here knows how off the top of their heads.

The docs for Lscript are poorly indexed so it's hard to get a search to return the chapter/page a command is at in them. You get scores of pages throughout the entire LW manual instead. Wish there was a columnar list of all commands/functions/operators/etc. in various sortings... alphabetical, categorical, etc.

Re. Mac compat... yes, since Lscript is cross-platform... it's not compiled. As to where to put it on a mac... <shrug> Shouldn't there be a newtek/lightwave/plugins folder? I made a plugins/other/modeler folder and put it in there. Then it's just a matter of adding it via Add Plugins and then making a menu button for it.


10-16-2008, 09:22 PM
That's a good idea about the plugin other folder. I have a huge LW folder dedicated to all my LW stuff. It's my favorite folder to go into. I'm either watching William's tutorials or practicing trial and error stuff. Fun Fun! Anyway, yes, I'll create a plugin other folder and check it out. Now does the PNG files to be in the same folder as well?

10-16-2008, 10:10 PM
Quick feature addition... same zip file name, so redownload.

Added file and path "memory" for iterative script execution so you don't have to go and find the file again.

Re. PNG images.... those are just sample renderings which you can use for spherical mapping on a star ball object. They have nothing to do with the script. Same for the LWO package... it's there for those that don't want to take the time to process the database and create their own star object.

I'm sure there are other uses for this script besides building star balls. As long as the first three input fields are star-like data (RA, DEC, DIST), the other two fields can be null/nill/"" columns. The script will assign default values for such missing data.

A feature for the future might be a selector for inputing c artesian (XYZ) coords instead of equatorial, but then there are scripts out there that already do this.


10-16-2008, 11:10 PM
Hey cool. I don't use plugins often so I'm sure how I would go about using it. Do I have a sphere in Layout and then use the plugin with it and then I would see nice stars?

10-16-2008, 11:12 PM
Just added a Right Ascension Units selection control in case your data for this input is in equatorial decimal hours format instead of cartesian decimal degrees.


10-16-2008, 11:23 PM
Guess I need to write up a little 'How to' file. Basically.... this script runs only in modeler. It creates a multilayered ball of stars. It gets the position data from a comma separated values (CSV) text file that contains star coordinate, brightness, and color data available on the web (use google to search for Tycho and/or Hipparcos catalogs).

You then color the horde of single-point polys using the script-created color vamp (advanced tab of the surface editor) and set the script-created surfaces to 100% luminous, 0% diffuse. Then adjust luminousity values less than 100 for lower magnitude surfaces and/or add a turbulence texture to luminousity to vary the stars even more.

In layout, load up the object, put the camera at 0,0,0, set each object layer's Edge/line attribute in Object Properties to various sized dots based on the magnitude (brightness) of each "layer." Then render away. Being a true 3D star field, you can fly thru it at warp speeds to generate subspace trails or other volumetric 3D star effects.


10-17-2008, 01:44 AM
Thank you...
Will redownload when i get home from work...

10-17-2008, 04:53 AM
Oh my God, it's full of stars!

10-17-2008, 06:11 AM
LOL... it's really 85% empty! There's 2.5 million stars in the Tycho2 catalog! I obtained only those that were brighter than magnitude 10 (human eye can only see up to mag 6 in the very best conditions). Imagine a ball of 2.5 million points! The LWO would be over 100 megs!

What's interesting is that even at 370K stars, the object is starting to take on a bit of a galaxy appearance!


10-17-2008, 11:11 AM
This is very cool of you to share. Im having trouble getting a render out of the scene though. An f9 gives me a black image with an alpha that appears to be right, but nothing in the rgb. Is there a setting I need to hit to make the points visible?

10-17-2008, 07:48 PM
The scene was made in LW 9.5.1 (beta), but I'm not using anything in it that isn't in 9.0 and onward. Check that you're "Render Lines" is enabled in the Render Globals > Render Tab.

Other than that, there isn't anything that I can see in any other options that would disable point poly rendering.

Indeed strange that your alpha is full of stars, but not rgb.

10-17-2008, 09:40 PM
Do you know the best settings for each star mag? Colour and luminosity? When I put it into Layout, it is a 1 meter sphere and I have to make it bigger. Really cool though but I want to tweak it since I'm going to create a scene tomorrow that is space oriented. Also, what is the best pixel size for each mag? I put everything at 1000m.

10-18-2008, 05:45 AM
if you used the database I provided in the first post, then I failed to mention that the column data field defaults in the script DO NOT MATCH the database columns! Sorry. You need to change them to match the header descriptions in the first line of the csv file, thus 1, 2, 3, 4, and 5. The defaults of 2, 3, 4, 5, and 6 are for csv files that have the star number in the first column.

Run the script with these new column #s and you will get a star ball that's over 40km in dia. Should then render correctly.

RE. point size and surface luminousity... more detailed than I have time to type at the particular moment, so download the object/scene package and look at what I've used.

10-18-2008, 07:14 AM
tk on the new info

awesome fun it is... :)

10-18-2008, 07:51 AM
Any way of putting in the code for naming the "parts" ??? Please Please
It's just naming 300,000 polys takes awhile...

Please please

just curious, organizing thing of mine ..

Script works great... :)

10-18-2008, 02:31 PM
Thanks for the help. The star sphere in LW is cool but a pain many times so this is great!

10-18-2008, 10:24 PM
Any way of putting in the code for naming the "parts" ? naming 300,000 polys takes awhile...
Unclear as to what you're asking. The script does separate each magnitude group in to its own layer complete with name. Same for surfaces.

How in the world do you "name" individual poly-point/vertices in the first place and why?