Jump to content
  • Advertisement
Sign in to follow this  
Gammastrahler

3D Tube or Pipe Forumula?

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

Hi, can someone tell me the formula for creating 3D tubes? (For example, to simulate a snake) I´ve tried to figure it out on paper, but i´m not sure how to put it into practive... Would be glad if you could give me some hints or a link to a website! Thanks gammastrahler

Share this post


Link to post
Share on other sites
Advertisement
Your question is a little bit vague. What is the goal?

I know there exist implicit formulations using an extrusion along a spline path. Perhaps for your app a facetted tube will be sufficient, so that an explicit mesh could be generated by "discrete" extrusion (i.e. going stepwise along a path and generate profiles that are to be connected to build up sections). If you choose a continuous curve as path, you may investigate curvature to get better looking results. If you have a piecewise linear path, well, then simply concatenate cones, possibly with spheres in-between to get closed joints.

Share this post


Link to post
Share on other sites
haegarr basically covered it, but I thought I'd mention that this was actually covered in some detail in the last couple of months. *goes to look for thread* ...Well, I'm not sure where the thread is, so that may be of no help to you. Anyway, the basic idea is to move a coordinate frame along a curve at regular intervals and create a 'circle of vertices' using the coordinate system at each point. These vertices can then be easily triangulated into a tube.

There are some details that have to managed though. What sort of curve you use is actually sort of secondary to the problem; all it really needs to provide is a position (evaluation) and tangent (first derivative) function. There's also the issue of parameterization; using arc length would give you slightly more even spacing at the expense of considerable code complexity, while using the parametric value directly would be much easier and would probably give perfectly adequate results.

The trickiest part is probably finding suitable frames along the curve. The Frenet frame may not be adequate, depending on the shape of the curve; a fixed-reference frame might work if the direction of the curve doesn't vary too widely; and a parallel transport frame might be the overall best choice. There's actually an article on curve frames that's very interesting, but I'm too lazy to go looking for it now. You might try googling for it though.

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!