• Welcome to Dark Bit Factory & Gravity.
 

OpenGL Tunnel?!

Started by Soulprayer, December 18, 2008

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Soulprayer

Hi,

well i am sort of a beginner but "successfully understand and compiled" the NeHe tutorials at gamedev.net ;)

But what i am looking for is an algorithm for a nice tunnel in OpenGL. :/

While working with the codes of NeHe i got some clues about 3D and so, but not really about an tunnel.
Sure i can use a loooooong torus or a camera tracking shot through a möbius strip, but it does not solve my problem...
I want it going random. To the left and to the bottom, to top and to the right, as i say: shaky.
Some bass XM in the background and on a random bass note the direction changes.

In fact, i think the easy part is with XM play and random changes, the difficult with my requirement to code a random tunnel going infinite.
My first demo showing a tunnel was Comas demo "Cocoon"  @ 40sec - 55sec (use the norway mirror)
http://scene.org/file.php?file=/parties/2004/start04/demo/comacocoon_partyrelease.divx51.avi&fileinfo
and ever since then i want to program my own tunnel with cool effects and some more.

Is my "project" possible?
If not, can you at last share with me some knowledge about programming a tunnel?
Many thanks

Regards
Soulprayer

ps: hope my english is good enough to understand my request

Hezad

Hi SoulPrayer and welcome here :)

Maybe you could store only a part of the tunnel : behind you, you don't have to calculate anything since you don't see it, but in front of you, you can calculate the tunnel faces position from your position to a selected distance : you can generate the tunnel while you're traveling in.

To handle memory, you can store calculated triangles in an array or a ptr and delete triangles behind you : like this, you won't need a huge amount of memory and since the tunnel is generated in real-time it can be totally infinite :)
Music + Coding :
http://Hezad.no-ip.org

Hosting / Hébergement :
www.hezad.com

benny!

@Soulprayer:

Welcome to the forum. Tunnels are indeed some very fascinating
effect. To have a basic understanding you might be interested in
a very old challenge which was held by this forum - have a look
at the posts in this thread for some tunnel examples (with sources):

http://www.dbfinteractive.com/forum/index.php/topic,80.0.html
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

relsoft

I love tunnels!!! My next game(if ever that comes at all) would involve an abstract tunnel.



Anyways,some tunnels I made in OpenGL:

Ascaris:
http://rel.betterwebber.com/junk.php?id=47

Flower tunnel:
http://rel.betterwebber.com/junk.php?id=57

Glass Tunnel:
http://rel.betterwebber.com/junk.php?id=91

Source included and I'll be online for 3days so you could post your Q's regarding the source anytime.
Challenge Trophies Won:

Soulprayer

Hey many thanks for your ideas, I'll try!
And I'll give me time to understand, don't expect me doing this in some days ;)

@relsoft
I love tunnels too! :)
The Ascaris demos are cool!
Thanks for the code, I'll work with it and try to do my demo in C++

@benny
Thanks, I'll have a look at them! :D

@Hezad
Good idea, i'll give it a try.

va!n

@Soulprayer:
some more infos about how you could code a tunnel effect:
http://www.dbfinteractive.com/forum/index.php/topic,1942.0.html
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

relsoft

Quote from: Soulprayer on December 18, 2008
@relsoft
I love tunnels too! :)
The Ascaris demos are cool!
Thanks for the code, I'll work with it and try to do my demo in C++


Guess what? I have a C++ version too!!!

http://rel.betterwebber.com/junk.php?id=48
Challenge Trophies Won:

matthew




Hi Soulprayer, there is a tunnel written in Delphi which uses OpenGL here.

I converted the program to Basic4GL some time ago & you can download it here.

I also had written a version of it in thinBasic which you can download here.

Source code & .exes are included with both downloads.

hellfire

#8
QuoteMy first demo showing a tunnel was Comas demo "Cocoon" and ever since then i want to program my own tunnel with cool effects and some more.
Well, the demo is called Coma and the group's name is Cocoon ;)

Quotei can use a loooooong torus [...] but I want it going random
I'm pretty sure for this specific tunnel Nytrik did exactly that in 3dsmax.
To do it procedurally, you could generate a torus along a spline where you create the position-samples from filtered noise (perlin or such).
You could generate segments of reasonable size as soon as they become visible and trash them after the camera passed through (- just as Hezad pointed out already).

May I ask where in NRW you are located?
Challenge Trophies Won:

Soulprayer

Whow, you're great!
Many thanks for your support! 
The tutorial is in German, great! :D
And thanks for the link to Cocoons hp!

Now i know what to do in my spare time over christmas and New Year's Eve!

va!n

@matthew:
oh you are right.. i totally forgot the site of my good old friend Sulaco from Africa who sadly died some years ago... He was a very very cool and friendly guy, where people can find and learn a lot about OpenGL coding!  :goodpost:
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

relsoft

Quote from: va!n on December 19, 2008
@matthew:
oh you are right.. i totally forgot the site of my good old friend Sulaco from Africa who sadly died some years ago... He was a very very cool and friendly guy, where people can find and learn a lot about OpenGL coding!  :goodpost:

WTF?!!! He's dead?!!! I learned a lot from that guy!  Man this sucks.
Challenge Trophies Won:

matthew

Quote from: relsoft on December 20, 2008
WTF?!!! He's dead?!!! I learned a lot from that guy!  Man this sucks.

Yeah he died back in 2002, his parents were featured in a religious documentary shortly after his death.

A copy of the documentary can be downloaded from this webpage.