Jump to content
  • Advertisement
Sign in to follow this  
Techoptrix

Deforming Objects

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

I am trying to find a direction for my final year project. I am looking at doing a 3d version of a 2d shoot-em up I did called Fren-zE for the PS2. The style of the game uses abstract primitives for creating enemies. I want to apply the same principle to generate 3d enemies by using cubes etc. I want the focus of my study to be the way the enemy explodes when hit by the players fire. Instead of having some predefined smaller pieces I want to destroy say the cube in real-time. How would I go about doing this and does anybody have any examples they can point me towards for reference?

Share this post


Link to post
Share on other sites
Advertisement
Doesn't really have anything to do with AI, but anyway.

If you're just using cubes then when a cube is destroyed create 9 new smaller cubes (3x3x3) and position them so that they would constitute the larger cube. You can then apply physics/whatever and send them off in various directions. This could also be recursive, continuously breaking the cubes to the level of granularity you desire.

Share this post


Link to post
Share on other sites
I'm moving this to the Game Programming forum since it has nothing to do with AI. I'm sure it will find an appropriate home once the original author better indicates what problems they are trying to solve.

Timkin

Share this post


Link to post
Share on other sites
why are you using only cubes, your gonna have to use triangles to make these cubes, so why not just use other shapes?

then when an object explodes, you could leave its polys as seperate entities somewhere and add an explosion vector to each of its points, the vector could be a normalized vector from the center of the poly to the center of the explosion.

Share this post


Link to post
Share on other sites
Idea:
To simulate cracking, you could clip the cube with "random" planes and give the pieces velocity pointed away from the splitting plane

Another thing could be CSG subtracting say an explosion sphere from the cube.

Share this post


Link to post
Share on other sites
I will be making the focus of my project something along the lines of the following:

An investigation into the use of (slice planes/clip planes) to create segmentation of a given object in real time, and how this compares to the existing methods employed in todays games.


I aim to be able to apply whatever the result is to more than just cubes, basically any poly.

Could anybody point me in the right direction for any resources on this kind of thing, i.e. how to apply a clip plane to a particular object for instance. I will then need to keep what would normally be discarded and join all the verts for both the new resulting objects from clipping and then use someting like looping through each of the new verts sequentially using tri strip to create the new faces.

Any ideas or discussions will be appreciated

Share this post


Link to post
Share on other sites
Applying the clip plane to slice an object is fairly simple, you just test each vertex for which side of the plane it's on, for this just googling on clip planes should give you plenty of info. This could also be sped up using spatial partitioning on the model, again googling for spatial partitioning should give you some useful information (one example is axis-aligned bounding box (AABB) trees). You'll also want to look at how to insert extra vertices into the model at the slice point (since you probably don't want the result of the slice depending on the resolution of the vertices in the model).

Capping the open ends after doing the slice is a little more difficult. When dealing with convex objects is easier than concave objects, so you many want to limit your project to convex objects.

Perhaps something you may also want to consider is using heightmaps to slice the object rather than planes. Not too much more difficult than using planes and will allow you have jagged slices as well as perfectly straight slices (eg something getting torn rather than cut).

Share this post


Link to post
Share on other sites
Thanks for the feedback. Yes, the slice plane route is going to be the path Im taking although I do like the sound of the heightmaps to create that irregularity. Since I dont want that style of effect when i come to make the game to demo the study, I will stick at researching slice planes and spatial partitioning.

For now I will too stick to convex objects to make life a little easier. I have never used slice planes before and although I have only just spent 10mins during break in lectures I havent been able to find any specific tutorials or discusions on their implementation for slicing an object and generating the new vertices, any links would be nice although I will research some more later.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!