开发者

Are there mathematical methods to creating graphics?

I came across this page a long time ago Steve A Baker And he mentions how one of the images on an earlier video game he created was done using a simple adder and math.

Are there mathematical methods to creating graphics?

How do you do this kind of thing? It would be really cool to create images mathematically. I have wondered 开发者_JAVA技巧(and googled) but only found descriptions about fractals. But I don't think this is a fractal. Thanks.


Procedural image generation is well known in the demoscene community. You can refer to some of the open source demos for a variety of techniques.


Just a quick example

Suppose you have a 200x200 RGB image, and you define each color component as follows:

 Red   = Sin[i/200]  
 Green = Tan[j/300]  
 Blue  = Sin[i j/300]

The result is:

Are there mathematical methods to creating graphics?


Evolvotron and other similar evolutionary art programs basically do nothing but randomly manipulate mathematical expressions to generate images (OK user input plays a part too, which is where the "evolution" bit comes in). Karl Sim's pioneering paper is well worth a read.


Well, what do you mean by create images mathematically? It's pretty vague, but in order to answer your question, I'll assume you mean create images using mathematical operations on a set of pre-defined data.

That's pretty simple. Just make a pattern using a Python list or the alike:

pattern = ['o', 'o', 'o', 'o',
           'o', 'o', 'o',
           'o', 'o',
           'o']

Then create a canvas-like thing to handle inserts and operations on it's contents (like changing colors, etc.).

I'm not sure how to answer, since you question is kind of vague...


Quite seriously, almost all of computer graphics is mathematical.

Your sample image could be done with a modulating function.

Trigonometry, linear algebra (matrices), vectors and calculus are all used in graphics.


check Aaron.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜