tunnel

Blitz3D Forums/Blitz3D Beginners Area/tunnel

Arvidsson(Posted 2009) [#1]
Hello folks!

Im new to this and thougt I learn by doing easy demoeffects in the beginning.

Now I thought I give it a go by trying to make a classic tunnel. Without using the 3dengine ofcourse :)

So if you know any tutorials to make easy tunnels that would be very appreciated.

Goal one: Travel through a straight tunnel in the middle.

Goal two: Make the tunnel bend when traveling trough in the middle.

Goal three: Move away from the center of the tunnel with the camera and spin around when traveling through the tunnel.


Or is this maby a stupid thing to try to do in the beginning?


Warner(Posted 2009) [#2]
If you want to create a mesh in code, you'll need to create an empty mesh. Then add a surface to this mesh. A surface is a collection of vertices (3d points) and triangles between these vertices (faces). Each surface can have a brush applied to it. A brush is a material than can contain one or more textures.
1. Create an empty mesh
mesh = CreateMesh()
2. Add a surface to this mesh
surf = CreateSurface(mesh)
3. Add vertices to surface
v0 = AddVertex(surf, -1, 1, 0) ;returns index of new vertex
v1 = AddVertex(surf, 1, 1, 0) ;returns index of new vertex
v2 = AddVertex(surf, 1, -1, 0) ;returns index of new vertex
4. Add a triangle to surface
AddTriangle surf, v0, v1, v2 ;use indices to create triangle
A more extensive example of these commands can be found in the 'flag' demo, in the samples folder.


Arvidsson(Posted 2009) [#3]
I want it as basic as possible in the beginning. No surfaces or such, just a tunnel made out of dots if possible.


Warner(Posted 2009) [#4]
Wait, are we talking about a 2D or a 3D tunnel ?


Arvidsson(Posted 2009) [#5]
2D tunnel. Mabye I should post this thread on the blitz max forum even if I use blitz 3d?


Zethrax(Posted 2009) [#6]
No, this is the right forum for Blitz3D related beginner's issues. The BlitzMax forums are only for BlitzMax stuff.

I'd suggest having a look through the code archives. You may find something useful in there.


Arvidsson(Posted 2009) [#7]
Ok, thanks Ill do that


_PJ_(Posted 2009) [#8]
There's this here:

http://www.blitzbasic.com/codearcs/codearcs.php?code=734


Arvidsson(Posted 2009) [#9]
Right on the money, thanks man. :)