Author Topic: OpenGL Tunnel?!  (Read 11091 times)

0 Members and 1 Guest are viewing this topic.

Offline Soulprayer

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
OpenGL Tunnel?!
« on: December 18, 2008 »
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

Offline Hezad

  • Sponsor
  • Pentium
  • *******
  • Posts: 613
  • Karma: 44
  • I believe .. in Patrick.
    • View Profile
    • Hezad.com Web hosting
Re: OpenGL Tunnel?!
« Reply #1 on: December 18, 2008 »
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 :)

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: OpenGL Tunnel?!
« Reply #2 on: December 18, 2008 »
@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:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: OpenGL Tunnel?!
« Reply #3 on: December 18, 2008 »
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:

Offline Soulprayer

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: OpenGL Tunnel?!
« Reply #4 on: December 18, 2008 »
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.

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: OpenGL Tunnel?!
« Reply #5 on: December 19, 2008 »
@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:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: OpenGL Tunnel?!
« Reply #6 on: December 19, 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:

Offline matthew

  • C= 64
  • **
  • Posts: 27
  • Karma: 2
    • View Profile
    • My Wikispace
Re: OpenGL Tunnel?!
« Reply #7 on: December 19, 2008 »



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.

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: OpenGL Tunnel?!
« Reply #8 on: December 19, 2008 »
Quote
My 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 ;)

Quote
i 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?
« Last Edit: December 19, 2008 by hellfire »
Challenge Trophies Won:

Offline Soulprayer

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: OpenGL Tunnel?!
« Reply #9 on: December 19, 2008 »
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!

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: OpenGL Tunnel?!
« Reply #10 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:
- 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:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: OpenGL Tunnel?!
« Reply #11 on: December 20, 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:

Offline matthew

  • C= 64
  • **
  • Posts: 27
  • Karma: 2
    • View Profile
    • My Wikispace
Re: OpenGL Tunnel?!
« Reply #12 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.