Ship Shield Effect

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
cdrwolfe
Posts: 100
Joined: Thu Nov 15, 2007 5:38 pm
Location: Cranfield University

Post by cdrwolfe »

So close i can almost taste it :D,

However i need to figure out one more thing, and that is how to correctly apply the normal to the quad i use to represent the shild impact texture.

So far i have used a previous quad class which places it on a plane so all it is now is flat.

I assume it means tinkereing with either of these two:

Code: Select all

// Add end tile texture to make it easier to see
            Vector3D topL = position + new Vector3D(-1.0f * scale, 0.0f, 1.0f * scale);
            Vector3D topR = position + new Vector3D(1.0f * scale, 0.0f, 1.0f * scale);
            Vector3D botL = position + new Vector3D(-1.0f * scale, 0.0f, -1.0f * scale);
            Vector3D botR = position + new Vector3D(1.0f * scale, 0.0f, -1.0f * scale);

            // Create vertices
            quad.verts[0] = new Vertex3D(topL, new Vector3D(1.0f, 1.0f, 0.0f), new Color(255, 255, 255, 255), new Vector2D(1.0f, 0.0f));
            quad.verts[1] = new Vertex3D(topR, new Vector3D(1.0f, 0.0f, 0.0f), new Color(255, 255, 255, 255), new Vector2D(1.0f, 1.0f));
            quad.verts[2] = new Vertex3D(botL, new Vector3D(0.0f, 1.0f, 1.0f), new Color(255, 255, 255, 255), new Vector2D(0.0f, 0.0f));
            quad.verts[3] = new Vertex3D(botR, new Vector3D(0.0f, 0.0f, 1.0f), new Color(255, 255, 255, 255), new Vector2D(0.0f, 1.0f));// = new Vertex3D[4]; 
But I'am not exactly sure how, anyone have a better understanding then I?

Regards Wolfe
cdrwolfe
Posts: 100
Joined: Thu Nov 15, 2007 5:38 pm
Location: Cranfield University

Post by cdrwolfe »

Thanks to a another previous vitek post I managed to get the normals to translate to the quads vertices :).

Textures i use are not the greatest but I'am no artist. Also there is still the problem of the texture over shotting the triangle edge but i can look to fix that later perhaps.

Here is a short vid.

http://www.youtube.com/watch?v=9ZPZREOUg9Q

Regards Wolfe
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

Wow really great! :shock:
cdrwolfe
Posts: 100
Joined: Thu Nov 15, 2007 5:38 pm
Location: Cranfield University

Post by cdrwolfe »

Trust me it looks worse in hi res lol :), for once bad youtube quality helped ;).

Still glad it is done, now all i have to do is apply it for enemy ships and then repeat for projectiles and pulse weapons :S.

Regards Wolfe
fukuda
Posts: 23
Joined: Mon May 14, 2007 6:32 pm
Location: Barcelona, Spain

Post by fukuda »

Your Pulse Weapon vid is also very cool :D
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

I think I just had a nerdgasm.

New underwear, STAT.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
robertgarand
Posts: 69
Joined: Fri Feb 22, 2008 6:47 pm
Location: montreal
Contact:

I made a shield effect for my game

Post by robertgarand »

Hi wolfe,
I made a shield effect for my game Nostalgia, source is available,
I rotate the shield at random, but you just can put a collision detection on the sphere and rotate the shield accordingly.
my game is here: http://game3d.easycdholder.com/5.html
Look at it and if you have questions...comme back to me.
The code is not well structured, my first prog in c++ :oops:

Robert
If it can't be writen, it can't exist
cdrwolfe
Posts: 100
Joined: Thu Nov 15, 2007 5:38 pm
Location: Cranfield University

Post by cdrwolfe »

Thanks robert,

Hard game to play :) though fun. I need to imrpove my depth perception i think. I will take a look at the source aswell.

Regards Wolfe
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

I also made a shield effect ages ago. It's not the best, I just use the distance functions for collision without scaling the line so it's always a sphere (good enough for what I needed).
Code is buried in here somewhere (yeah I know the code is horrible, but the shield effect looks good imo)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
cdrwolfe
Posts: 100
Joined: Thu Nov 15, 2007 5:38 pm
Location: Cranfield University

Post by cdrwolfe »

Nice bitplane, i managed to get the getCollisionPoint() to work out quite well, bar the fact it needs the shield mesh to be visible and also it seems have its absolute position updated before a line is called to collide with it.

Could i be an absolute student thief and possibly use a copy of your shield textures :), compared to mine they are the adonis of textures :).

Regards Wolfe
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hey guys,

did no one minded to use a shader?

Searching the net i found the Proximal Shader for Cinema4D does Irrlicht has something equal or can i write the Proximal Shader for myself?

Btw i want to learn how to make Shaders because i want to improve my little space game. Could anyone tell me the best tutorials?

MfG
Scarabol
lymantok
Posts: 67
Joined: Mon Dec 31, 2007 6:13 am

Post by lymantok »

Working link to Robert's Nostalgia: http://robertgarand.com/monsiteweb_anci ... ocs/5.html
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Shader Shielding

Post by freetimecoder »

Hi
Scarabol wrote:did no one minded to use a shader?
I found this topic a while ago and I have been working on a "modern" shield implementation:
Image
(Uhm ignore the scene, those are battle cruisers with death rays of course)

The ShieldEffect interface is not yet finished, but I think I can release it within the next days (or nights, for that matter).

So far, it can use different shield textures and impact gradients per shield and radius sizes / durations per impact. It also transforms impact positions for the shader from a ray.

Basically you can use any mesh object for the shield.
It uses the meshbuffer drawing trick for the point lighting shaders here: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=36308 for "unlimited" impacts.

greetings
lymantok
Posts: 67
Joined: Mon Dec 31, 2007 6:13 am

Post by lymantok »

Cool! Looking forward to seeing it released!
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Hi,

the raw coding is complete, now I have to optimize here and there and comment everything.

To shorten the waiting, here is a screenshot:
Image

and a windows binary:
http://www.file-upload.net/download-253 ... n.zip.html

(I think the final code does not belong in this thread anymore, so I will create a new one in Code Snippets).

greetings
Post Reply