Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: ben_g on July 25, 2014, 01:55:59 pm

Title: [axe] 3D collision detection library
Post by: ben_g on July 25, 2014, 01:55:59 pm
So, I've written a library to handle collisions in a 3D world.

I'll explain the features used in the demo based on some screenshots:

Demo room 1
(http://img.ourl.ca/colldemo-room1-bewerkt.gif)

The main feature of tis octogonal room is that it has diagonal walls. It may seem like something ordinary, but diagonal walls are actually quite complicated, and most raycasting engines are unable to render diagonal walls.
This room also has a pillar in the middle that demonstrates a use of the collision hooks: it starts to rise when something (the player) is on top of it, and it descends again when nothing is on top of it.
Nothing here
Demo room 2
(http://img.ourl.ca/colldemo-room2-bewerkt.gif)

This is the most complex room (especially when it comes to rendering) of the demo, so I cheated a bit and used 15MHz for this room. All other rooms do run at 6MHz though.
Anyway, this room is to demonstrate how moving platforms can be used. The horizontally moving platform uses a collision hook to move any objects on it with the platform, while the vertically moving one can work witouth a hook because of gravity.
Ignore this text
Demo room 3
(http://img.ourl.ca/colldemo-room3.gif)


This is just a simple hallway.
Simple white line
Demo room 4
(http://img.ourl.ca/colldemo-room4.gif)


This room uses a floor with a collision hook to create a trampoline. When you hold down the jump key (2ND), you gain a bit of altitude with every jump, when you don't hold 2ND, you lose a bit of altitude with every jump untill you stand still. Jump trough the window to get to the next room.
YAEL (yet another empty line)
Demo room 5
(http://img.ourl.ca/colldemo-room5.gif)


This room uses a ghost object to detect if the player is above the pit, and adjusts the shape of the room to make the player fall.
Last line of transparent text
Demo room 6
(http://img.ourl.ca/colldemo-room6.gif)


This room uses yet another ghost object to detect if the player is in a certain area: When the player is inside the "teleporter", it shows some text, and when the player presses ALPHA, it loads the first room again.
That's all the demo has to offer.

If you are interested in using this library, then check out the file "collision library.txt" in the zip that I'll attach to the post. It contains the documentation about everything the library has to offer.
Title: Re: [axe] 3D collision detection library
Post by: Matrefeytontias on July 25, 2014, 05:08:54 pm
Wow, just ... Wow O.O stunning work ! I'll sure give it a try ! I assume it's intended to be used with GLib ?
Title: Re: [axe] 3D collision detection library
Post by: Sorunome on July 25, 2014, 05:10:42 pm
Just WOW, this is looking awesome O.o
Title: Re: [axe] 3D collision detection library
Post by: ben_g on July 25, 2014, 06:06:11 pm
Wow, just ... Wow O.O stunning work ! I'll sure give it a try ! I assume it's intended to be used with GLib ?
It is indeed intended to be used with GLib, but it doesn't use any of it's routines. It only handles the collisions, not the graphics. Therefore, it should work fine with any kind of raphics you like, wheather it is GLib, your axiom, or even a tilemap (if I have time, I might make a tilemap example in the future).
Title: Re: [axe] 3D collision detection library
Post by: ClrDraw on July 25, 2014, 10:13:07 pm
This is amazing! I think you've earned the rainbow emoji:  *.*
Title: Re: [axe] 3D collision detection library
Post by: Streetwalrus on July 26, 2014, 06:02:24 am
Holycrap this is freaking amazing. *.* Great job Ben_G ! :thumbsup:
Title: Re: [axe] 3D collision detection library
Post by: AndyLi on July 28, 2014, 11:41:49 am
The graphics looks simple but beautiful !!
Incredible work  :thumbsup: