Progress thread for original version (2006)

A DOOM-style 3D engine for TI-83 and TI-83+ series calculators.

Moderator: benryves

User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Dude, get real :mrgreen:
Sounds like you need "BSP trees for dummies",
unfortunately that page (http://qxx.planetquake.gamespy.com/bsp/) is offline :P
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

I still haven't made a single BSP tree generator in my life. I still know the overall algo and here's my tut:

1) Insert line, by splitting it against the infinite representations of the existing lines already in the BSP.
2) Go to 1 until there are no more lines.

Done. Would be real nice to see a BSP-based 3D app on the calc :)
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

I've been a bit busy of late, but I've changed a few things; still no occlusion or clipping (boo!) but there are now variable height sectors (as well as a variable camera height).
Image
The odd flickering lines in places are due to 8-bit overflows when truncating a 16-bit screen coordinate to an 8-bit one. Note the smoothness (24/16-bit divisions for projection to screen rather than 16/8 and a lookup table) and the backface culling on the central "cube".
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

Post by the_unknown_one »

This looks nice, ben!
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Wow, it's so fast... Pretty incredible :)
The backface culling doesn't work very well with the variable camera height yet though. When you look on top of the central cube you don't see the full top square. Pretty amazing nevertheless ;)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Timendus wrote:Wow, it's so fast... Pretty incredible :)
I wouldn't take the GIF speed as accurate... it looks roughly accurate in Opera, and fine in ImageReady, but it runs super-fast in IE. :(
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Great work ben, are you planning on using this for anything or just trying to hurt use! :P Looks amazing, and I hope something develops from this.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Even if I don't use it in a game myself, I'm aiming for the engine to be nice and modular (along with a simple level format) so that it's easy enough for someone else to plug a game into it. Of course, this also means that if it crashes and burns, someone else can help me out (for example, all vertices transformed and rotated by code in one source file, then the walls are projected and drawn in another, input handling and movement in yet another and so on).
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

I wonder, why is there no backface culling on the outer cylinder?
Nice to see moving screenies, not a lot of them around here lately :)
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

coelurus wrote:I wonder, why is there no backface culling on the outer cylinder?
The wall is flagged as being double-sided.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Wow, awesome stuff ben! Perhaps you can use it in another demo?

Also, the outer cylinder can have its back-faces culled also? (any object can i guess?).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

The current data structures are:

Code: Select all

vertices:
.dw <x>, <y>
...

lines:
.db <start vertex>, <end vertex>, <flags>, <sector>
...

sectors:
.dw <ceiling height>, <floor height>
...
So, by clearing the least significant bit in a wall's (line) flags byte, it will be culled if required. Setting it sets the wall as double sided, so it is never culled.
User avatar
GuillaumeH
Regular Member
Posts: 143
Joined: Fri 17 Dec, 2004 8:30 pm
Contact:

Post by GuillaumeH »

benryves wrote:Even if I don't use it in a game myself, I'm aiming for the engine to be nice and modular (along with a simple level format) so that it's easy enough for someone else to plug a game into it.
That would be great news to have at last a 3D engine ready to be used for a game :) Hold on, benryves!
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

I'm having real issues with clipping lines (walls)... I haven't implemented anything in assembly yet, it's all being done in QB for the moment. ;)

A thread on GDNet.

The problem is more detecting whether a line lies completely outside or just inside the view, as I'm currently "accidentally" moving certain walls that were completely outside into the view, or ending up with zero-length walls on the x=y or x=-y boundaries.
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

I don't understand the issue, could you elaborate or rephrase only the problem and not the general idea? Should the discussion be continued in the GD thread?
Post Reply