Monday, 4 July 2011

Vertex Manipulation [Compound objects]

Just a short update on what I've been working on this time. It started when I was playing CoD:WaW this afternoon and I noticed a lot of debris and broken walls which got me thinking about how they managed these kinds of assets. This intrigued me, so I started drawing up some ideas on how I could potentially add this to the toolset, with little knowledge on mathmatical geometry or destruction calculations I tried to start things simple and look for existing online resources.

I will go into much more detail on this topic at a later time, for now I'd just like to share a few images and give notes on what you see.

ray vs. triangle collision. white lines visualize an array of lines from the camera eye colliding with the geometry.

The box-mesh on the left was used to cut 4 holes into the plane-shape.

The wireframe of the same scene, visualizing the triangles of the triangulated plane.

A hole cut by defining 5 vertices by colliding a ray with the plane, these were defined at runtime from the camera-eye.

I'm also looking into 'bridging' (users of 3D Studio Max may know what I'm talking about) to fill the gap between two planes of a wall (its back and front) after cutting a hole with the triangulator. Some basic box uv-mapping and a noisy texture to simulate broken concrete (or any other material) and you should have the basics to quickly create holes in walls or break chunks of the scene's meshes. The resources I used are listed below. Much more on this at a later time, there is still a lot to do and even more to talk about :)

Resources

App Hub - Triangle Picking Sample

Nick Gravelyn's Triangulator (2D)

Triangulation By Ear Clipping - by David Eberly

5 comments:

  1. I'm really impressed with your work, please keep posting stuff like this :)

    I've been planning on making a game using XNA for the longest time. I really want to build a solid ~engine from the ground up, like you're doing.

    ReplyDelete
  2. Hi Martin,

    I will keep posting, thanks ;) The last thing I worked on since this post was terrain rendering, something I've ignored for a long time (eventhough my first game used a terrain, it was a heightmap + non-tiled huge diffuse map that looked kinda horrible :P) I will probably post something about this soon(ish) but I've also started a new UDK project that will take a lot (if not most) of my time for the months to come.

    So, I will keep posting, probably slightly less frequent :)

    ReplyDelete
  3. Nooooooo! Don't do it! :D


    Ah well, I'm looking forward to more posts :>

    ReplyDelete
  4. I would be impressed if you'd do this in C++, but XNA... Sorry, but I don't see this technology in professional games. Managed environment is not a good way in doin' this (I don't mean mobile apps).

    ReplyDelete
  5. Hi,

    What exactly is wrong with Managed environments? I can definitely agree if you don't want to run your game purely on a managed language, I would prefer using C/C++ libraries for things like physics, rendering and other components that are often a performance bottleneck...and I think C# is great for gameplay/editor functionality, and what I'm working on mostly on this blog is gameplay and editor features, which work well with C#.

    ReplyDelete