Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Mandelbrot/Fractals  (Read 2596 times)

0 Members and 1 Guest are viewing this topic.

clypto

  • Newbie
  • *
  • Posts: 1
    • View Profile
Mandelbrot/Fractals
« on: January 31, 2011, 01:54:58 pm »
Hi everybody :D

Im new to SFML and as a first project Im trying to program the Mandelbrot set. I did the same with the canvas2d library in java so I know how to go about it, however there are a few questions I cannot answer with my limited experience in SFML. Since the calculations for a Mandelbrot set need to be fast, meaning the paint methods should have a high performance Im having a few unresolved questions:
How can you a draw a point and set its color?
Should I draw every point at a time or whats the most efficient way to do this in SFML?

regards and thank you in advance,

aline

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Mandelbrot/Fractals
« Reply #1 on: January 31, 2011, 02:02:04 pm »
A 1px small square shape would let you draw a dot and set it's color pretty fast.

http://www.sfml-dev.org/documentation/1.6/classsf_1_1Shape.htm
Haven't changed much between 1.6 and 2.0
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Mandelbrot/Fractals
« Reply #2 on: January 31, 2011, 02:12:38 pm »
Drawing things to generate an image is really a bad idea. Generate the whole image in a pixel array, and then display it once it's finished. This will always be the fastest solution.
Laurent Gomila - SFML developer

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Mandelbrot/Fractals
« Reply #3 on: February 02, 2011, 03:57:29 pm »
It would be even faster to do this in a shader.

JAssange

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Mandelbrot/Fractals
« Reply #4 on: February 02, 2011, 04:21:06 pm »
You'll need to do this in a shader or performance won't be tolerable.

 

anything