C++ Fractals

Discussion in 'Computer Gaming Forum' started by RyanGamerGoneGrazy, May 28, 2007.

  1. RyanGamerGoneGrazy

    RyanGamerGoneGrazy Clubbies Are Minis Too!

    Joined:
    Jun 7, 2005
    Messages:
    1,911
    Likes Received:
    6
    Hey all


    Our last project (and worth the most marks) in the comp-programming course is to create a c++ Fractal program using visual studio. I believe they were a mandlebot fractal, and a fractal of our choice. Does anyone have any links to tutorials/help on creating one visual c++ fractals?

    BTW: Fractals make good desktop backgrounds



    Ryan
     
  2. mairsil

    mairsil Officer at Arms

    Joined:
    Apr 20, 2005
    Messages:
    3,425
    Likes Received:
    153
    Standard reply:

    "We're not here to do your homework for you." :lol:

    Are you looking for fractal generation algorithms or information on drawing to a Visual C++ form?
     
  3. RyanGamerGoneGrazy

    RyanGamerGoneGrazy Clubbies Are Minis Too!

    Joined:
    Jun 7, 2005
    Messages:
    1,911
    Likes Received:
    6
    I'm looking for mainly the generation algorithms, or even just info on visual c++ fractals, I've covered chaos game before, but nothing else, so really I'm looking for some good info on them

    Ryan
     
  4. Jamtex

    Jamtex Adult Orientated Mahjong Connoisseur

    Joined:
    Feb 21, 2007
    Messages:
    5,472
    Likes Received:
    16
    Don't know about C, but here is a mandlebrot generator in QBASIC. Read up on Mandlebrots, they aren't that hard to figure out.

    SCREEN 13
    CLS
    a% = 0
    FOR p = 0 TO 63 STEP 2
    c = 63 - p
    PALETTE a%, 63 + 256 * p
    PALETTE a% + 32, c + 63 * 256
    PALETTE a% + 64, 256 * 63 + p * 65536
    PALETTE a% + 96, c * 256 + 63 * 65536
    PALETTE a% + 128, p + 65536 * 63
    PALETTE a% + 160, c * 65536 + 63
    a% = a% + 1
    NEXT
    PALETTE 193, 0
    sx% = 320
    sy% = 200
    v = 2
    xm = 2
    ym = 2
    xs = -2
    ys = -2
    FOR y% = 0 TO sy%
    FOR x% = 0 TO sx%
    p = xs + x% * (xm - xs) / sx%
    q = ys + y% * (ym - ys) / sy%
    i% = 0
    cx = 0
    cy = 0
    DO
    xn = (cx * cx) - (cy * cy) + p
    yn = (2 * cx * cy) + q
    r = (xn * xn) + (yn * yn)
    IF r > v ^ 2 OR i% > 192 THEN EXIT DO
    i% = i% + 1
    cx = xn
    cy = yn
    LOOP
    PSET (x%, y%), i%
    NEXT
    NEXT
    DO WHILE INKEY$ = ""
    LOOP
     
  5. RyanGamerGoneGrazy

    RyanGamerGoneGrazy Clubbies Are Minis Too!

    Joined:
    Jun 7, 2005
    Messages:
    1,911
    Likes Received:
    6
    ahh cool, thanks for the basic code,heh, doesnt look that bad :)



    Ryan
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page