objects on walls

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.
Post Reply
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

objects on walls

Post by Armen138 »

i want to have a certain weapon to leave a permanent trace on the walls it hits,
like for example bulletholes.
what i think is the way to do it, is to find the intersectionpoint and place an object on the
wall at that point. now this is all easy, the only thing is that the object then needs to be rotated
to be at the same angle as the wall behind it. I have tried using getNormal to get the angle from
a triangle on the wall, to rotate the new object, but it doesn't work.
Does anyone know how to do this?
or am i maybe aproaching the problem the wrong way? is there another way to achieve what
i want?
Miwa
Posts: 28
Joined: Wed Feb 18, 2004 10:48 pm

Post by Miwa »

Are you attaching the decal to the wall as a child, or is it at the same level in the tree?

If you attach it as a child, I'd guess that it'd get the same transformation as the parent, so you likely just need to offset one of the 3 positions in it's relativePos. May work, as long as you don't end up with Z-fighting at some point.
Guest

Post by Guest »

i think that would only work if each wall is loaded as a separate mesh, im using .bsp maps..
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

that was me of course, i forgot to log in :oops:
Mercior
Posts: 100
Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:

Post by Mercior »

Any updates on this? I'm trying to do it for my game too but I can't figure out the bit of maths needed to turn the normal vector into a rotation vector fro my scenenode
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

I don't have any irrlicht specific info, since i haven't begun my bullet hole demo yet, but you might find what you need at http://www.flipcode.com/tutorials/tut_decals.shtml
Post Reply