A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: How the hell did he do this?

  1. #1
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194

    How the hell did he do this?

    Found this F8 example online

    http://oos.moxiecode.com/flash8/iso_terrain_noise.html

    I can see the displacement map in the lower right, but I'm more interested in the actual terrain effect itself, because it runs damm fast. Any ideas of how that was acheived? is it real time 3D?

    boombanguk

  2. #2
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    it quite simple, i have made a similar creation (check the perlin wave in my footer)

    the map in the corner is a bitmapData with perlinNoise applied, not a displacementfiltermap.

    then all you do is plug the colour values read from the bitmapData into the z-ordinates of your 3D engine or _y values. and thats it.

    in his case he does not use real 3D, this is why it is soo fast and my example is a little slower,

    HTH,

    zlatan
    New sig soon

  3. #3
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    if he's not using real 3D what is he using? is it just lots of MC's at different heights? I would of thought that many would slow it down.

  4. #4
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    from what i can tell he has a function which draw an oblong with a certain height,

    so all he is going is redrawing each oblong using his function and passing colour values passed to the function as the heights for the oblongs.

    as for your question about the speed, look at it like this, my example is pretty fast, seeing as i generate perlinNoise using 15 channelOptions, use a 3D engine which uses trigonometric functions to transform 3D coordinates into 2D, and i recolour each "particle"

    all he has to do is generate grayScale perlinNoise and redraw the oblongs. hence the preformance.

    HTH,

    zlatan
    New sig soon

  5. #5
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    so he's just drawing 15x15 (225) oblongs, from back to front? thats it? its not a ray tracing engine? using the drawing class to draw 225 oblongs is faster then just having 225 movie clips?

  6. #6
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    yes.

    mines 30x25 (750) + all the other processing.

    if you dont belive me try it for your self,

    zlatan
    New sig soon

  7. #7
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    I believe you! ...thanks for the info. Nice examples.

  8. #8
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    cheers,

    just a tip, make the buffer bitmapData, (the one which you read the colour values from), as small as possible and dont attach it to a movieClip, this way you are not rendering any pixels which you dont need to, plus the bitmapData will not then get processed by the GPU, these will increase the speed.

    have a go, and if you need help or a simplistic example come back and ask.

    zlatan,

    p.s. i dont know what browser you are using but you may need to click on the perlin wave movie to see that it rotates with the mouse
    New sig soon

  9. #9
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    one thing i don't understand. Couldn't this example have been done in Flash MX? why does it need Flash 8?

  10. #10
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    well it could have been done in flash mx or whatever, but you would have to then create your own algorithm for generating smoothingly changing values to be used as the _y values or z-ordinates; instead of just reading the values of a automatically generated colour pattern.

    zlatan
    New sig soon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center