5,696,038 members and growing! (11,449 online)
Email Password   helpLost your password?
Multimedia » General Graphics » Bitmaps     Intermediate

Really cool visual FX

By dswigger

A set of classes for doing stunning visual effects, including water, plasma and fire.
VC6, C++Windows, NT4, Win2K, MFC, VS6, Visual Studio, Dev

Posted: 20 Aug 2001
Updated: 20 Aug 2001
Views: 311,651
Bookmarked: 150 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
170 votes for this Article.
Popularity: 10.69 Rating: 4.79 out of 5
5 votes, 5.1%
1
1 vote, 1.0%
2
0 votes, 0.0%
3
6 votes, 6.1%
4
87 votes, 87.9%
5

Sample Image

The Code Project is on FIRE!

This project has a set of 3 classes that will let you add some pretty cool looking effects (real-time) to images/dibs.

Again (as with my wave editor control) I pulled these out of my code archive, dusted them off, and made a little project that some people might find useful. ie: I did not document much at all.

After running the demo click on the 'Animate' button. Then move your mouse across the image, click, then play with the other settings. The sliders are used to change the alpha (transparency) of the plasma and fire effects. You have to release the slider for the alpha change to take effect.

You generally see these effects used in real-time demos, which is where I culled most of the source from and converted it into a more object oriented class design. I was originally going to use them as the basis for a series of VIS type plugins to be used in an audio application. As commonly happens that project sort of went to the wayside.

I included the CDibSectionLite class created by Chris Maunder in the project just so I had something to render onto/with. The effects expect all data to be 32bit depth image data.

CWaterRoutine - Renders the real popular water effect
CFireRoutine - Renders simulated fire
CPlasmaRoutine - Renders real-time plasmas

By looking at the code for these effects you should notice they are all based around the idea of using a separate filter to achieve their results. If you have never looked at the water code (for example) you will be amazed at how such simple routines can create such a wonderful effect. Same goes with the plasma and the fire. Try playing around with some of the data members - you can do a LOT more than what my sample application allows.

The animation is achieved with a simple windows timer. The only notable thing about it is the way I chained the effects together, by rendering one on top of another.

You are free to use the code as you wish, just drop me an email if you use it in something interesting, extend it, want to complain about my lack of documentation (again), or just want to say "hey!".

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

dswigger



Location: United States United States

Other popular General Graphics articles:

  • A flexible charting library for .NET
    Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
  • CxImage
    CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
  • 3D Pie Chart
    A class library for drawing 3D pie charts.
  • ImageStone
    An article on a library for image manipulation.
  • Gios PDF .NET library
    A .NET library for generating impressive PDF reports.
Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 122 (Total in Forum: 122) (Refresh)FirstPrevNext
Generaldoes anyone have a version without memory leaks?membersfgasdfas@asdfasdf.it23:18 5 Oct '08  
Generalanyone has a version without the problem of the buffer overrun?memberasdf34asdf23:34 4 Jun '08  
GeneralC# or VBmemberJohnny J.5:28 22 Jan '08  
GeneralRe: C# or VBmemberdswigger9:30 22 Jan '08  
GeneralThank you for your share!memberMember 404584121:17 11 Dec '07  
GeneralAnother memory leakmembermbw33018:14 3 Sep '07  
Generalfatal errormemberalaa naeem22:10 22 Aug '07  
GeneralRe: fatal errormemberasdf34asdf22:42 4 Jun '08  
GeneralWhy so complicated???memberchris17510:37 22 Aug '06  
GeneralRe: Why so complicated???memberwaldermort6:46 14 Sep '06  
GeneralRe: Why so complicated???memberdswigger9:46 22 Jan '08  
GeneralWater effectmembernzembs14:21 3 Dec '05  
GeneralDLLmemberRoland838:10 15 Oct '05  
GeneralTwo bitmapsmemberst0per16:30 3 Jul '04  
GeneralRe: Two bitmapsmemberhongzh12616:35 14 Sep '05  
GeneralWater ErrormemberSilentDragonz17:11 20 Apr '04  
GeneralRe: Water Errormemberdswigger8:18 21 Apr '04  
GeneralRe: Water ErrormemberC.Young @ XiCabin22:05 9 Dec '05  
GeneralRe: Water Errormemberebia.tty05:09 24 May '06  
GeneralAbout the water effectmembercaucy15:38 20 Apr '04  
GeneralRe: About the water effectmemberdswigger8:21 21 Apr '04  
GeneralRe: About the water effectmembercaucy15:55 21 Apr '04  
GeneralI don't know how to contact you.memberFai19:27 2 Sep '03  
GeneralRe: I don't know how to contact you.memberdswigger11:29 24 Oct '03  
GeneralRe: I don't know how to contact you.memberdswigger11:30 24 Oct '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 Aug 2001
Editor: Chris Maunder
Copyright 2001 by dswigger
Everything else Copyright © CodeProject, 1999-2008
Web19 | Advertise on the Code Project