Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Galaxy demo  (Read 1599 times)
0 Members and 1 Guest are viewing this topic.
Offline StrideColossus
« Posted 2013-02-09 12:13:57 »

As a slight departure from my usual projects I thought it would be nice to see an animated galaxy model.  I was hoping that there would be star coordinate data freely available on t'interwebs, Hipparcos is one, but the data is only for relatively nearby stars so you just end up with a sphere of stars centred on the Sun - not very interesting.

So I changed tack and re-used my terrain mesh building code to load a picture of a galaxy as a height-map.  I used this one (can't remember which galaxy it is though):



Obviously there is no 'height' as such in a flat image, to generate the galaxy disk and bulge I randomized the vertical coordinates, with the range being higher in the bulge and tapering off towards the edge of the disk.  The colours of the 'stars' are the pixel colours in the image, after discarding pixels with a total luminance below a certain threshold, i.e. the resultant model does not have a 'star' for every pixel of the image, only the brightest ones.

Here's a side-on view:



Edge on:



Close-up:



The galaxy model is rendered using a 'point cloud' mesh re-used from my particle system code, each 'star' is a point-sprite with the shader creating a imposter sphere, blended with the stars behind it and ordered by distance.  With the cut-off threshold I applied there are about 50K stars in the model and it renders way above 60 FPS, though obviously goes slower as more stars are added.

I'm quite pleased with the results for what turned out to be relatively little work using (largely) existing code.  It's far from perfect and there's plenty more that could be done: it doesn't look too great close-up (perhaps to be expected), and the blending can look a bit clunky sometimes (need to experiment with other functions).  I'd be interested to see if anyone else has tried anything similar.

- chris
Offline Varkas
« Reply #1 - Posted 2013-02-09 12:23:35 »

So I changed tack and re-used my terrain mesh building code to load a picture of a galaxy as a height-map.  I used this one (can't remember which galaxy it is though):

The structure matches our own galaxy. The short central bar, and the branching arms match quite well. There sure are enough barred spiral galaxies which looks similar, but bets are that this is a visualization of our own galaxy.

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Offline StrideColossus
« Reply #2 - Posted 2013-02-10 11:37:32 »

The structure matches our own galaxy. The short central bar, and the branching arms match quite well. There sure are enough barred spiral galaxies which looks similar, but bets are that this is a visualization of our own galaxy.

Expect you're right, I think I remember finding that image when searching for Milky Way star data, and our galaxy is suspected to be a barred spiral.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline delt0r

JGO Knight


Medals: 27
Exp: 18 years


Computers can do that?


« Reply #3 - Posted 2013-02-11 12:01:10 »

Its not our galaxy. It is one that is like ours... we think. Remember we only decided it was a bar galaxy pretty recently.

The star catalogs work for close stars. That is ones where we can measure the distance via the parallax method. This works out to a few 100lty IIRC. The milky way is about 100,000lty across, and contains something like 100 to 400 billion stars.   

Interesting approach.

I have no special talents. I am only passionately curious.--Albert Einstein
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (9 views)
2014-09-21 23:33:17

BurntPizza (28 views)
2014-09-21 02:42:18

BurntPizza (18 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (46 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!