POV-Ray : Newsgroups : povray.binaries.animations : Creating tunnels... (MPGs, 2x126 kb) : Creating tunnels... (MPGs, 2x126 kb) Server Time
19 Jul 2024 00:59:47 EDT (-0400)
  Creating tunnels... (MPGs, 2x126 kb)  
From: Tim Nikias v2 0
Date: 10 Feb 2004 18:23:13
Message: <402967e1@news.povray.org>
So, I've picked up on working on my Worm-Short again. So, where did that
lead me?

Problem #1: A Worm lives in the earth, so I need tunnels. How should I
create those? Especially since I have one complicated scene involving a
tunnel which might need to be outsourced to Java for preprocessing of
particle interaction...

Solution #1: Use a whole bunch of CSG cylinders and spheres, and cut a tube
from that.
Analysis: Too costly on parsing (tons of objects) and rendering (heavy CSG)

Solution #2: Extrude a circle along a path, thus build deformable mesh-tube.
Analysis: What happens when the circles don't line up properly?

...

And that's where these two animations finally came from. The tunnel_jagged
shows how a circle might be extruded along a Bezier-Spline (hence the "Some
math aid required..." thread in advanced-users). Orienting the circle along
the path isn't trivial if you want to have one smooth go which may be easily
connected via triangles. My approach was to simply take the direction it
should point to, and rotate the face of the disc to align with the normal.
This may introduce some internal spinning to the discs, especially if the
directions change from front to back, up and down etc.
For further effect and test of the following script, I've introduced some
random rotation to the discs, and thus I get tunnel_jagged.

So, what I do now is build the nodes, but then I check the second circle to
properly line up with the first: seek the two closest points (one on each
circle), then "twist" the nodes on the second circle to align the indices
with the two closest points. Repeat for third in relation to second, fourth
to third, etc.

And that's how I get tunnel_corrected.

If anyone's interested in even more detail, let me know. My main aim with
this post was to see if anyone has any other solution which is still trivial
and doesn't involve heavy-duty algebra to solve, hence the already pretty
detailed description.

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de


Post a reply to this message


Attachments:
Download 'tunnel_jagged.mpg' (127 KB) Download 'tunnel_corrected.mpg' (127 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.