I'm trying to create some kind of demo that rushes through a tunnel.(adsbygoogle = window.adsbygoogle || []).push({});

I have made a random path generator that creates smooth looking paths in 3D space (just some 3D points)

Now I would like to create polies that form a tunnel around that path.

To give an example, let us assume that the path only extends towards the Z axis.

(so path_pos.x and path_pos.y will remain 0)

then I could define the positions of the vertices as:

x = path_pos.x + cos(t)*radius;

y = path_pos.y + sin(t)*radius;

z = path_pos.z;

However, as mentioned before, I would like the polies to form a smooth tunnel around that path,

and the path rotates to the x and y axis as it progresses.

This means that we have to adjust the formula, else it would start looking deformed, and

the radius of the tunnel would be depending on the angles between the path points...

(See the given image, the small green circles represent the path points,

and the red lines represent circles on which I have to define the points of the polies)

(first image is the problem rendered with 3dsmax,

second and third are images made with paint to represent the problem more mathematically)

images: http://www.dropbox.com/gallery/22326841/1/Tunnel_Problem?h=293d6e

As we can see from the image, the x and y component from path_pos2

could actually be the same than the ones from path_pos1,

with a different Z component for every point in the circle.

I could define the following:

z = path_pos.z + ( ( cot( (anglebetween([p1,p2],[p2,p3])/2 ) * (radius*2) ) *

( (radius*2)/(radius+(y-p2.y)) ) );

But I think this is only the case because the line(path_pos1,path_pos2) is parallel to the Z axis.

When the path starts making 'rotations'/'turns', both around x(pitches) and y(yaws) axis,

I'm not sure how to define the points around the pathpoint that should form an ellipse,

so that the radius of the tunnel would remain the same (except in the actual corners, for efficiency).

I really hope this doesn't sound like a garbagestorm, I tried my best to explain...

Could anyone please help? :)

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Geometry: problem with defining the vertices of a tunnel around a given path

Loading...

Similar Threads for Geometry problem defining |
---|

A How to calculate the second fundamental form of a submanifold? |

I Diffeomorphism invariance and contracted Bianchi identity |

A Smoothness of multivariable function |

A Smooth extension on manifolds |

I Problems in Differential geometry |

**Physics Forums | Science Articles, Homework Help, Discussion**