开发者

A galaxy with stars, milkyway and other stuffs (WPF)

What is a "realistic" way to build a galaxy in 2D with WPF?

I'm not interessed in the physical modelling but the graphical aspect with WPF controls/effects. At least the stars (position, size, color, pulsing etc.) should be generated from code. Generating milkyways would be nice. (See update bellow.)

Main questions are:

  • Stars: lens flare? texturing?
  • Milkyway: bump mapping?
  • "Far" stars: textures? generated?
  • Pulsing?
  • other elements, any effects are welcome!

Some examples (taken from the web, I want to build similar pictures (animations) with wpf):

A galaxy with stars, milkyway and other stuffs (WPF)

A galaxy with stars, milkyway and other stuffs (WPF)

Update

The goal of this project is to visualize huge data structures. "Ga开发者_运维知识库laxy" is only a semblance.

From birdview it's similar to code_swarm but based on WPF. So this is not an astronomy application or something, just a view for hierarchical data.


  • Background stars: use one or two "star patch" images, and splatter them around in the background, with random angles, in random positions, and flipping them horizontally and vertically. Sample: http://www.sea-of-memes.com/LetsCode4/LetsCode4.html

  • Foreground stars: use 5-15 'flare' pre-made gray-scale textures (1 per size) and colorize them slightly so each star has its own hue.

  • Nebulae: Generate a random rectangular texture with perlin noise. The alpha must also be controlled by the perlin noise, so the image is transparent in some spots. Make them big and fade the borders, so they are seamless. Each nebulae must be colorized. Experiment putting very faint, big nebulae in the background, so the space isn't completely black in all places.

  • Galaxies: Same as the nebulae, except that with much less alpha, and the border fading is less gradual and more "oval" in shape.

I don't recommend pulsing. If you want to add some animation, simulate movement by adding different scroll levels (so the objects that are far away don't move at all, but the ones near the camera move more)

Oh and also:

  • Put a link to the result here :)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜