Jump to content

Generating random background...

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
bentoh

bentoh

    Newbie

  • Members
  • Pip
  • 4 posts
is it possible to write a program that randomly generate a background like this??? :confused:

Posted Image

the background consists of 2 shapes, with different contrast and size...

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
This looks like a typical result of many particle physics programs with gravity. I'm sure it's possible by randomly "dropping" objects into the top of the circle and letting them settle.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
bentoh

bentoh

    Newbie

  • Members
  • Pip
  • 4 posts

WingedPanther said:

This looks like a typical result of many particle physics programs with gravity. I'm sure it's possible by randomly "dropping" objects into the top of the circle and letting them settle.
The "dropping" idea is good :) but the particle physics stuff uses balls ... and mine with different shape... :irritated:

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I've seen particle physics that use squares, triangles, and other shapes. The essence of it is to be able to detect collisions between objects and prevent overlap.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
bentoh

bentoh

    Newbie

  • Members
  • Pip
  • 4 posts
to detect collision is still ok but to make them jam packed is very hard since every shape is "bounded" by a rectangle... :irritated:

#6
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
Why not first, make the background a solid color. Then drop the two shapes in at random where no other shap exists. They will not have to be bounded because the background color will create the remaining shapes.