Posts

Showing posts from 2009

Extruding profiles along paths.

Image
Well, a quick update from me. I have now complete my extrusion code. This allows you to take a path and a profile, for example some bezier splines, and will generate a textured mesh of the result. This is a real building block for creating rooms, but has been rewritten completely since the original version. I've knocked up a simple WPF viewer to examine the results and to check that the texture mapping works ok - other than an axis flip, it looks pretty good. As the examples show, the code supports different smoothing angles for profiles and paths and will also seal the ends of the path using the triangulation, discussed in some earlier posts. Anyway, it's great progress. I stand at a bit of a divide now. To progress to start writing the WPF application, or to consider a tough cookie - creating a 3D CSG engine. I don't strictly need the latter and it could be a huge diversion, but the challenge is tempting. Well, back to it ...

Moving on ... Polygon Triangulation Progress

Image
I've finally moved on from the polygon expansion code, which works very well now.* My new challenge has been to create a polygon triangulation service. For those in the know, triangulation is a useful process for creating 3D meshes. Models tend to be built from triangular faces, so, in order to create 3D models for RoomBuilder, it is important to be able to move from the 2D to 3D world. The triangulation code does this. Essentially, it divides a polygon into non overlapping triangles to create a solid face. There are many different ways of approaching triangulation, most of which are concerned with either speed or mesh quality. It is possible to implement very efficient, scalable solutions for convex polygons, however, reflex verticies make the triangulation process more difficult. At the moment, I am not so concerned about speed. I would rather have a reasonably efficient, robust routine that can be easily debugged, than something more esoteric and potentially harder to maintain. ...