#### Archived

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.

## 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 on other sites
Heh, do a lazy bastard and add a fade effect so it looks like the wave is dispersing.

##### Share on other sites
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 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 XZ = (d)*(cos(angle + step));    //outer ring ZX = (d - thickness)*(sin(angle + step)); //inner ring XZ = (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.

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.

voila.

Dredd

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

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633708
• Total Posts
3013468
×