Ship Shield Effect
Ship Shield Effect
Hi all,
I just wanted to ask if anyone had any good ideas on how to replicate a shield hit effect, common in most space combat games.
Is there some way of setting a texture to be transparent and then somehow highlight the areas where the shield is hit? or would i have to look into using some kind of shader.
Regards Wolfe
I just wanted to ask if anyone had any good ideas on how to replicate a shield hit effect, common in most space combat games.
Is there some way of setting a texture to be transparent and then somehow highlight the areas where the shield is hit? or would i have to look into using some kind of shader.
Regards Wolfe
Well luckily i currently have a sphere scene node which is scaled into an ellipsoid to act as the ships collision detection. So i could probably use that. I tried previously to add a material to the sphere meshs but for some reason it screwed up the collision detection part. I normally loop through each vertex of the mesh to get there position but it wouldn't allow me this time lol, i recall something about 3DS files having odd vertexes i.e x2 but can't quite remember.
I would like the effect to cover the sphere mesh or at least partially eminating from where the beam hits.
I guess using a billboard wouldn't work because it always faces the camera and is flat.
Could i use a texture / decal and then apply it somehow to a set of vertexes of the mesh, making it partially transparent?
Regards Wolfe
I would like the effect to cover the sphere mesh or at least partially eminating from where the beam hits.
I guess using a billboard wouldn't work because it always faces the camera and is flat.
Could i use a texture / decal and then apply it somehow to a set of vertexes of the mesh, making it partially transparent?
Regards Wolfe
Is it possible to create something similar to taht in this video?
http://www.youtube.com/watch?v=r7H6HBZS ... re=related
Would it be possible to apply multiple textures to the sphere to represent multiple hits, my guess would be yes but how exactly to mould it to the shape of the shield.
Hmm needs investigation
Regards Wolfe
http://www.youtube.com/watch?v=r7H6HBZS ... re=related
Would it be possible to apply multiple textures to the sphere to represent multiple hits, my guess would be yes but how exactly to mould it to the shape of the shield.
Hmm needs investigation
Regards Wolfe
As long as your shield is elliptical, it should not really matter. A flat textured plane that is aligned to the normal of the sphere should look okay.
If you are lazy then you just need to use a texture animator (to animate the texture) and scale animator (to make it grow), and a delete animator (to delete each decal when animation is done).
Travis
If you are lazy then you just need to use a texture animator (to animate the texture) and scale animator (to make it grow), and a delete animator (to delete each decal when animation is done).
Travis
The only hard thing i have in my mind is how to align the texture which for brevity we shall say is a roundish texture to align with the beam contact point on the shield.
Do i have to run through each vertex of the mesh and which is closest to my beam end point. If i find it do you happen to know exactly how i could apply the texture at that point.
Or perhaps if you know the terminology which describes the problem so i can search around. Half my problem is i only a little of the names of techniques so finding solutions is a bit of a problem. I only found out about projected textures the other day lol, though in this case i don't think it is applicable.
Kind Regards Wolfe
Do i have to run through each vertex of the mesh and which is closest to my beam end point. If i find it do you happen to know exactly how i could apply the texture at that point.
Or perhaps if you know the terminology which describes the problem so i can search around. Half my problem is i only a little of the names of techniques so finding solutions is a bit of a problem. I only found out about projected textures the other day lol, though in this case i don't think it is applicable.
Kind Regards Wolfe
I don't understand why you wouldn't be able to use getCollisionPoint(). If the shield is itself a mesh that is part of a scene node, you should have no problem. The nice thing is that will also get you the surface normal for orienting the quad.
You could use projective texturing to do this, but you'd have to figure it out and implement it.
Travis
You could use projective texturing to do this, but you'd have to figure it out and implement it.
Travis
-
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm
If I were to have a go at this problem I would probably create a partial dome and animate the color of the verticies. Moving an alpha line down the verticies one row at a time without worrying about blending from row to row. That would create a nice looking pulsed wave, with a cool texture on it, it would probably work well.
The shield is itself an animated scene node made from a sphere 3DS mesh.
However i can't seem to get it to work correctly. Because the beam fires from one ship to another means if i draw a line from the ship cannon to the target hitpoint there is a chance of interescting another ships mesh.
Now i think i've got around this by just reversing the direction. by firing a line from the target hitpoint to the ships cannon and in theory it should leave the ships mesh and hit the shield.
However because getCollisionPoint doesn't have a bitmask check it is possible for the collision to detect the targt ship before it has reached its shield simply because some of the hitpoints lie within the ship.
Seems to be a bit temperamental, but i will check my code.
Regards Wolfe
However i can't seem to get it to work correctly. Because the beam fires from one ship to another means if i draw a line from the ship cannon to the target hitpoint there is a chance of interescting another ships mesh.
Now i think i've got around this by just reversing the direction. by firing a line from the target hitpoint to the ships cannon and in theory it should leave the ships mesh and hit the shield.
However because getCollisionPoint doesn't have a bitmask check it is possible for the collision to detect the targt ship before it has reached its shield simply because some of the hitpoints lie within the ship.
Seems to be a bit temperamental, but i will check my code.
Regards Wolfe
Well it seems i might have got it to work correctly.
Thanks Vitek, you were right the getCollision emthod should and did work. The problem originally was that i passed the ships scenenoce rather then the shields scene node. I though it would only need the shields mesh lol.
Here is a pic, as you can see i ended up drawing 3d lines of everything to debug the problem lol.
If you want to know the hardcore math way of getting a point which intersects an ellipsoid, someone kindly posted a solution, though it might take some work to decipher
Go to http://www.mathhelpforum.com/math-help/ ... psoid.html
to see solution.
Now all i need do is get the normal for the triangle.
Regards Wolfe
Thanks Vitek, you were right the getCollision emthod should and did work. The problem originally was that i passed the ships scenenoce rather then the shields scene node. I though it would only need the shields mesh lol.
Here is a pic, as you can see i ended up drawing 3d lines of everything to debug the problem lol.
If you want to know the hardcore math way of getting a point which intersects an ellipsoid, someone kindly posted a solution, though it might take some work to decipher
Go to http://www.mathhelpforum.com/math-help/ ... psoid.html
to see solution.
Now all i need do is get the normal for the triangle.
Regards Wolfe
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
triangle3d::getNormal() ?cdrwolfe wrote:Now all i need do is get the normal for the triangle.
This is looking interesting. Do you have a project announcement up?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Once i get the AI working i'll probably post a project update. It is written in C# though using Irrlicht.Net and because it was the first thing i ever coded in C# some of the early work is pretty crap.
I think the 600+mb memory footprint after a while shows i might have made a few mistakes in my coding .
Anyway it is a combat engine (I hope) for the current Birth of the Federation II projects at Star-Trek-Games. They have much better coders and artists then I though .
Regards Wolfe
I think the 600+mb memory footprint after a while shows i might have made a few mistakes in my coding .
Anyway it is a combat engine (I hope) for the current Birth of the Federation II projects at Star-Trek-Games. They have much better coders and artists then I though .
Regards Wolfe