문제

I'm looking for a graphic library that allow me to plot a pixel point in a specific color with the purpose of draw a fractal (mandelbrot set). I've read the basic math behind fractal and I understand it, the algorithm is not difficult.

But I don't know what graphic library could I use, I don't need anything sofisticated and complex, just print a pixel set with colors. What do you suggest me? Cairo? OpenGl?.

Note: I only have experience with pygtk. I was reading the Java API and found the the fillRect method and BufferedImages but it seem a little complicate.

Thanks ;)

도움이 되었습니까?

해결책

Unless you want to compute 3D fractals (in which case a library like JOGL Java OpenGL can help), a simple java.awt.Graphics.setColor( java.awt.Color aColor) is enough.
(as show in this program).

In other word, the default awt library in Java should be up to the task: see "Graphics: setColor(Color c)".

다른 팁

I have implemented both mandelbrot and the flame fractal algorithm in native java (no openGL).

The most efficient way is to just store color in an int array or similar, and then save it as an image file (png or jpg). It is much quicker than using Graphics.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top