• Welcome to Dark Bit Factory & Gravity.
 

New project, early source..

Started by Shockwave, January 30, 2007

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Shockwave

I've been asked by someone to make an intro for a group which I will not be able to post on this forum, had an idea to make a better version of my boxtunnel  and have glenze vectors or something like that flying out of the tunnel.

Just as a gift, I've attahed a rar including the source code for the tunnel part of it. It will look completely different when it's done but the source may be useful to some so here it is..
Shockwave ^ Codigos
Challenge Trophies Won:

Rbz

That's a nice tunnel, run smoothly here  :goodpost:
Challenge Trophies Won:

rdc

Thanks for sharing man. Cool stuff.

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

benny!

Totally awesome. Thanks for sharing and adding code.
inc karma
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

.:] Druid [:.

thanks a lot for your help shockie! 
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Shockwave

YW...

This is how it looks at the moment..
Shockwave ^ Codigos
Challenge Trophies Won:

rdc


.:] Druid [:.

[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

DrewPee

Shockwave
that sure is some fast code . . . it draws so fast on my machine! I don't understand exactly how the routine works but I will check it out and have a looksee!!
Drew

ps Karma up+ for the code!
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Shockwave

The tunnel is using an interesting dodge to keep the speed up and eliminate the need for any sorting or z buffer. essentially all I have done is to create a series of diminishing squares, these are treated as 3D points, but in fact it's no more involved than writing a 3D starfield. You see, the tunnel never actually moves, I just add a variable to it, the variable moves forward and when it's advanced by one square it is re-set. This means that the tunnel is always drawn from back to front. Then it is a matter of adding some sine and cos to each layer of the tunnel to make it bend, in the full version it rotates, but a simple rotation around one axis is not hard.


        X = COS(theta) * XX - SIN(theta) * YY
        Y = COS(theta) * YY + SIN(theta) * XX


Theta is just a posh way of saying rotation angle.
Shockwave ^ Codigos
Challenge Trophies Won: