Sign in to follow this  
ManagedJack

How to build a circular arc mesh at runtime?

Recommended Posts

ManagedJack    128
Hi, I'd like to build a 3D-Environment with DirectX 9 that shows a track built of some 3D-curves such as straight and bended metal rods (circular arcs). The layout of the track is read from an xml-file. The problem is that an arc may have any length and radius. I started with modelling fixed-size meshes for the arcs, but that doesnt't cover all the possibilities (well, it's hard to model an infinite amount of meshes). I also thought of piecing together the arc with simple boxes, but that leads to intersections and gaps. Have you any ideas that could help me building these arcs? Is there maybe a function to create a mesh on device creation by extruding a plane (e.g. the profile of the curve)? The profile is the only thing which is constant. I think drawing arbitrary arcs is a common problem, but I didn't find adequate information yet. Thanks, Jack P.S I'm using MDX, but I think that is not a matter for this problem...

Share this post


Link to post
Share on other sites
axon    100
What you're trying to do is sometimes referred to as "Procedural Modelling".

Have you had a look at how the vertices of a cylinder are computed in Tutorials 4 & 5 of the DX9SDK?

Also, Bezier curves and Bezier Patches are more complicated but are a good way of describing curves.

Gamasutra.com has an article with source code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this