Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Shock Wave Special Effect

This topic is 5517 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to do a shockwave special effect in DX. I''ve tried doing a textured quad and scaling it, but width of the "ring" gets larger. The shockwave should basically move outwards and get larger, but the ring width should remain the same... shouldn''t be this hard! Any thoguhts would be great. Thanks, Jon

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Heh, do a lazy bastard and add a fade effect so it looks like the wave is dispersing.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Yeah, the width of the ring in reality would get larger, becuase some particals are moving faster then others. Adding the fade really helps.

But what am I talking about, in reality wouldnt the shockwave be a sphere?

Share this post

Link to post
Share on other sites
ill give you a viable technique and leave the implementation to you.

what you need to do is to create a circle of triangles.

the easiest way to do this is by using the;

x = d(sin(angle))
z = d(cos(angle))

where Y(height expression) is constant.(but not necessarily)
where X = X world space coord
where Z = Z world space coord.

imagine yourself staring into the positive Z axis.

as you rotate, you stop in equal degree offsets. lets say you rotate 20 degrees each step.

so step = 20 degrees.

you need to determine a thickness for your ring, lets put it at 5 units.

so thickness = 5

you also need to determine a size for your shockwave, lets say we pick 30.

so d(which means distance from your center point) = 30 units.

here's our formulas;

X = (d)*(sin(angle + step)); //outer ring X

Z = (d)*(cos(angle + step)); //outer ring Z

X = (d - thickness)*(sin(angle + step)); //inner ring X

Z = (d - thickness)*(cos(angle + step)); //inner ring Z

loop thru and create your circular mesh.

by increasing or reducing your step variable, you can draw smoother or less detailed circles.

next set up your render state, i recommend additive blending.

to expand it, you need to scale it up as you pass thru render cycles.

finally make sure and fade it out as it gets larger.



[edited by - Dreddnafious Maelstrom on November 6, 2003 3:50:41 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!