Is there any way to achieve a tunneling wormhole effect like this: http://www.janthor.com/tunnel/index.html
in Javascript or possibly C#. Although I know nothing in C# and a lot in Javascript. Since it was done in flash I’d think it could be don in one of these languages. Been stuck on this for a while. Posted this over on the forum but didn’t get any answer that worked.
Help’s much appreciated.
I am into this as well and have considered the following options:
a) Static Tunnel – Create a static mesh tube in a 3D program, import the mesh and move a camera through the tube
b) TubeRenderer – An open source script the renders tube meshes. Concurrent meshes can be created in order to obtain the tunnel effect.
c) Draw lines – draw wireframe tunnels on the fly. Works best with the drawing API in Unity Pro, but can be done with LineRenderer in Unity Indie.
d) Particle – Create particle systems that flows in the direction of the tunnel in order to create a fake movement of the spectator.
e) Shaders – Create the tunnel effect solely as a shader program and apply the shader to a plane. No 3D world exists expect in the shader code. Very fast though!
f) Mesh deformations – Create a static mesh in a 3D program, and deform it in real time in Unity. Use texture animation for movements.
The shader is only a few lines of code (GLSL tunnel shaders exists open source and can be used in Unity3D), but gives limited options for control of the tunnel effect (unless you are very much into math).
I consider option f) as the most easy to achieve, but at the same time a little limited if you want a real 3D world outside the tunnel as in this example:
So the nice version would be to create the tunnel mesh on the fly and let it follow some kind of procedural generated spline. A bit complicated though! Looking forward to more answers.
Anyway if anybody has a nice tube mesh (hollow cylinder) that they want to shade, please post a link - I have had problems with the inside normals in the ones I tried.
I would consider, for creating an effect similar to the Flash-project you linked to, procedural mesh creation and a static camera. If you want to make something quick then create a tube-mesh and let a camera follow a path which you animate and loop.
you could import a very long cylinder model, use sine deform example to deform it, reverse the normals in it or change the backface culling to put textures inside it, and place the camera inside the tube. then just move the textures and bend the tube. if you use sine cosine on x amd y z but keep the player and the centre of the tube on the 0 0 0 origin then that part of the tube will stay in the same place.
or you could generate it with mesh planes, as per mesh plane examples.