Putting a hole in a quad

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
esaptonor
Posts: 145
Joined: Sat May 06, 2006 11:59 pm

Putting a hole in a quad

Post by esaptonor »

I have a quad/triangle/anything, and I want to actually put a hole in it, not decals or anything, when a cannon goes through it. This means i have to change its geometry dynamically, but I have little knowledge as to how to do such a thing.
Can someone explain the basics and/or how to go about this idea?

thanks,
esaptonor
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

well you can code this by vertex subdivsion... but it will be really cool if you replace the quad which is predicted to by hit(use cannon ray and collision manager) with cubes simulated by a physics engine.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
esaptonor
Posts: 145
Joined: Sat May 06, 2006 11:59 pm

Post by esaptonor »

well yeah, my aim eventually is to have it split into broken bits that go flying, but first i need to learn how to dynamically break apart the quad or triangle.
How do I do that within irrlicht?

I guess i need explained how to add vertices to any mesh at any point so that i can make a hole.
If its possible to break a face off a model that would work too i guess.
I dont currently understand how the vertices and indices actually work either, for example, when i tried adding indices to the array of an smeshbuffer to create some new triangles with a new vertex i added also, the whole thing stopped saying 'user defined break point' even though i didn't set any...so if someone could explain that i would be greatfull too.

Thanks again,
esaptonor
dwmitch
Posts: 52
Joined: Thu Nov 09, 2006 9:29 pm

Post by dwmitch »

I've given up on this long ago, but for a while I was toying around with the notion of incorporating constructive solid geometry (CSG) for the impact zone and a custom particle system for debris.

There's a CSG library around somewhere, but I can't remember what it's called. I gave up on it before trying to see how/if it would work with Irrlicht, but it might be something you want to check into.
Post Reply