Jump to content
  • Advertisement

Archived

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

akn81

Blasting a hole thru a wall

This topic is 5981 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

Hi, I''ve been wrestling with this problem for weeks: Lets say I have a wall composed of triangles, if I shoot a cylinder (like a phaser blast from star trek) at it, how do I reshape the wall to leave a cylinder shaped hole, and create a cylinder inside it? Test scenario: a cube with 6 sides, 8 triangles per side gets shot by a cylinder with 8 triangles at its base. The cylinder touches the center of one of the cube''s sides. I now have to move the affected side''s triangles about, leaving a gap so I can move the cylinder inside. What''s the algo for that? I''m so frustrated and would appreciate any help. I''m not using CSG by the way, so there really is nothing inside my cube.

Share this post


Link to post
Share on other sites
Advertisement
If that were easy, every FPS would do it. The problem is possible (read up on constructive solid geometry, ie. newmesh=cube-cylinder) however it''s very computationaly expensive and results in lots of little polygons. When used in a game it will probably wreak havoc on your level organization, so major slowdowns will occure when you have to recalculate the bsp tree or whatever else you use. Another major problem with this has to do with texturing. What texture do you use for the inside of a wall? if one side is a brick, and the other is plaster, your level editor would have to store information on "inside" textures also. Basically, it can be done but it''s not easy, luckly if you do a google search, you will find lots of info on this because it''s been around for a long time. Tron was actually rendered (raytraced) using constructive solid geometry because back then they didn''t have the storage for fully polygonal models.

Share this post


Link to post
Share on other sites
exactly as Pseudo said, but thought I''d add you might want to look into the "Boolean" geometry operations - Boolean Subtraction, Addition, Intersection ... (sometimes OR/AND/NOT terminology is used)...

hth
Jack

Share this post


Link to post
Share on other sites
What about putting a decal on the wall with a bump map on it to look like it has a big dent in it? Would probably be much less hassle, and look better, assuming you can support bump mapping in your project.

Share this post


Link to post
Share on other sites
I would think that generally you would only want that to be possible with certain walls, i.e. secret areas. So to actually do it in a game one option seems to be to use a model for that section of wall and have before/after models. Of course if you want to procedurally generate the after model then that leaves the original problem.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You could have som kind of anti-z decal that change the z-buffer, and then draw the polys behind the wall afterwards... and you could also have a mesh inside the wall that is seen. it could work. wouldn''t be a "real" hole that can be shot through unless you add some special code for that too though

/ Jolle

Share this post


Link to post
Share on other sites
When I first saw this thread I thought of a decaling method, but it is possibly wandering away from what you are trying to achieve and dependant on the rendering api you are using. I''ll throw it in anyway...

Render the box with an alpha channel for each face. At the beginning each alpha channel would cause the faces to be rendered solid, then you''d have to cut "holes" in the alpha channels as they are hit.

The advantage would be that you can hit it as many times as you like with no complex mesh adjusting algorithms that will take time and increase the triangle count (increasing rendering time).

There''s still one oddity though... what happens if the user shoots a complete line of holes all around the perimeter of the face? - the middle section should fall to the ground!

Share this post


Link to post
Share on other sites
quote:
Original post by matibee
When I first saw this thread I thought of a decaling method, but it is possibly wandering away from what you are trying to achieve and dependant on the rendering api you are using. I''ll throw it in anyway...

Render the box with an alpha channel for each face. At the beginning each alpha channel would cause the faces to be rendered solid, then you''d have to cut "holes" in the alpha channels as they are hit.

The advantage would be that you can hit it as many times as you like with no complex mesh adjusting algorithms that will take time and increase the triangle count (increasing rendering time).

There''s still one oddity though... what happens if the user shoots a complete line of holes all around the perimeter of the face? - the middle section should fall to the ground!


Unless you''re using 3 dimensional textures(no, not cubemaps) then this suggested method would artefact horribly. Its not really viable, and if it were this easy, then it''d be common in nowadays games. Not trying to make you feel bad or anything though.....

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!