### WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

### Author Topic: X3D - A 3D engine for TI68k & Nspire Calculators  (Read 25523 times)

0 Members and 1 Guest are viewing this topic.

#### catastropher

• Full User
• Safe-haven access
• Join Date: Apr 2015
• Location: US
• Posts: 125
• Post Rating Ratio: +11/-0
• Gender:
##### X3D - A 3D engine for TI68k & Nspire Calculators
« on: June 27, 2015, 02:37:43 am »
Earlier this year I posted on Omnimaga about X3D, my 3D engine for the 68k calcs. After a month hiatus for health reasons, I resumed work on it in May Some of you may recall the dazzling light bridge from earlier this year:

Currently, I am in the process of rewriting the engine to support more complex geometry. It's been a long and slow process (I'm currently interning full time as a software engineer), but I've started to make some progress. The last version had levels which were constructed of interconnected cubes. The player could walk around inside the resulting structure, which proved to be very efficient. However, my whole goal of starting X3D was to get Descent to run on the 68k calcs, and many rooms in Descent are constructed of 20 or more cubes, which is just too much to handle. So, this new version will allow levels to be constructed of prisms instead of just cubes. What do I mean by prisms? Here's an example of an octagonal prism:

The idea is you have two bases, each with the same number of points. However, the bases can be stretched, skewed, and rotated, so long as the resultant 3D shape is convex. My ultimate goal for Descent 68k is to merge the cubes in complex rooms into large convex prisms. This is several times more efficient to render than the same room partitioned into cubes.

So far, I have created a new clipping algorithm that clips prisms against a 2D polygon. A fast algorithm for this is crucial for a portal renderer like X3D. So far so good!

Anyway, this time around, it's going to have a lot of cool features. I'm hoping to get some people involved on the project or at least make some games with it once complete (it will be a TIGCC/GCC4TI C library). Let me know if you're interested!
« Last Edit: February 11, 2016, 08:38:16 pm by DJ Omnimaga »

• Calculators owned: TI-83+, TI-83+ SE, TI-84+ SE, TI-Nspire CX, TI-92+, TI-89 Titanium
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

#### CKH4

• Extravagant Sushi
• Super User
• Join Date: Jan 2015
• Location:
• Posts: 872
• Post Rating Ratio: +3/-2
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #1 on: June 27, 2015, 02:41:43 am »
Holy cow thats impressive. This looks great. Maybe we'll get some cool 3d stuff.
• Calculators owned: TI-83+, TI-84+

#### catastropher

• Full User
• Safe-haven access
• Join Date: Apr 2015
• Location: US
• Posts: 125
• Post Rating Ratio: +11/-0
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #2 on: June 27, 2015, 02:53:16 am »
Hey thanks! I may even write a scaled down version in Z80 assembly if I can get it fast enough. Unlike most 3D renderers for the calculators, X3D only ever draws lines for the level geometry. Thus, everything is solid without filling any polygons. This makes it really really fast I may also write a tutorial on how to do this type of rendering as it's a bit involved and I'd really like to teach other people all the techniques I've found or discovered myself.
• Calculators owned: TI-83+, TI-83+ SE, TI-84+ SE, TI-Nspire CX, TI-92+, TI-89 Titanium
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

#### CKH4

• Extravagant Sushi
• Super User
• Join Date: Jan 2015
• Location:
• Posts: 872
• Post Rating Ratio: +3/-2
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #3 on: June 27, 2015, 03:40:25 am »
So are the things solid? I'm confused by the third screenshot.
• Calculators owned: TI-83+, TI-84+

#### catastropher

• Full User
• Safe-haven access
• Join Date: Apr 2015
• Location: US
• Posts: 125
• Post Rating Ratio: +11/-0
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #4 on: June 27, 2015, 03:44:50 am »
Yup things are solid, it's just easier to work in wireframe as I'm developing the clipping algorithm
• Calculators owned: TI-83+, TI-83+ SE, TI-84+ SE, TI-Nspire CX, TI-92+, TI-89 Titanium
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

#### CKH4

• Extravagant Sushi
• Super User
• Join Date: Jan 2015
• Location:
• Posts: 872
• Post Rating Ratio: +3/-2
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #5 on: June 27, 2015, 03:50:33 am »
So instead of polygon filling you just don't draw the lines that are covered up?
• Calculators owned: TI-83+, TI-84+

#### catastropher

• Full User
• Safe-haven access
• Join Date: Apr 2015
• Location: US
• Posts: 125
• Post Rating Ratio: +11/-0
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #6 on: June 27, 2015, 05:00:40 am »
Exactly! To achieve this, I use a modified version of portal rendering. Pretty much, you have a 3D polygon that is your portal (such as a doorway). Through this portal you clip any lines against the portal. So longs as your rooms are convex, you can draw them in any order and it makes things solid! Suppose we have this level (the camera is blue and the portal is colored orange, also please forgive my mspaint skills and crappy 3D drawing skills ):

(click to show/hide)
• Calculators owned: TI-83+, TI-83+ SE, TI-84+ SE, TI-Nspire CX, TI-92+, TI-89 Titanium
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

#### CKH4

• Extravagant Sushi
• Super User
• Join Date: Jan 2015
• Location:
• Posts: 872
• Post Rating Ratio: +3/-2
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #7 on: June 27, 2015, 05:05:09 am »
But with this method you would theoretically have to split up some lines right? In your diagram you have that but what do you do to accomplish it?
• Calculators owned: TI-83+, TI-84+

#### DJ Omnimaga

• Omni founder & CW co-founder
• CodeWalrus Staff
• Super User
• Forum Maintenance
• Original 5
• CodeWalrus Supporter
• Topic Management
• Join Date: Nov 2014
• Posts: 18271
• Post Rating Ratio: +91/-4
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #8 on: June 27, 2015, 05:29:24 am »
That really looks impressive Catastropher. Thanks for sharing this project. I am curious about what kind of game could be done using this engine.

• Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
• Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

#### catastropher

• Full User
• Safe-haven access
• Join Date: Apr 2015
• Location: US
• Posts: 125
• Post Rating Ratio: +11/-0
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #9 on: June 27, 2015, 05:59:28 am »
But with this method you would theoretically have to split up some lines right? In your diagram you have that but what do you do to accomplish it?

Indeed you do. There are a few different algorithms to accomplish this. The canonical polygon clipping algorithm is Sutherland-Hodgman (https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm). For a prism, you'd have to clip each polygon separately (a prism has n + 2 polygon, so for an octagonal prism you'd have to clip 10 polygons) and then draw the visible edges after clipping. Worse, it has a time complexity of O(n^2), and you're running it for each polygon. I'm working on a better algorithm for prism clipping, but I'm still working out all the details. I'll make a post when it's done

That really looks impressive Catastropher. Thanks for sharing this project. I am curious about what kind of game could be done using this engine.

Thanks! I hope people will get interested in it and make some cool stuff! But I'm still developing the core, so it may be a bit before it's ready.

Thanks for the concern, that's really nice of you It's nothing too bad, just some rheumatoid arthritis that flares up every once in a while (yup, I have it at 20 )
• Calculators owned: TI-83+, TI-83+ SE, TI-84+ SE, TI-Nspire CX, TI-92+, TI-89 Titanium
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

#### Lionel Debroux

• Full User
• Join Date: Jan 2015
• Location:
• Posts: 217
• Post Rating Ratio: +11/-0
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #10 on: June 27, 2015, 06:34:15 am »
Looks good, as before. Keep going
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.

#### Snektron

• Lvl 69 Russian Snake
• CodeWalrus Staff
• Super User
• Topic Management
• Join Date: Dec 2014
• Location: Netherlands
• Posts: 3155
• Post Rating Ratio: +31/-0
• SSSssssss.....
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #11 on: June 27, 2015, 09:49:44 am »
Whoa, awesome! So how good does this compete against glib for example?
Also i thought Portal used FrameBuffers and all that advanced stuff for portals
• Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

#### TheMachine02

• Full User
• Join Date: Dec 2014
• Location:
• Posts: 335
• Post Rating Ratio: +14/-0
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #12 on: June 27, 2015, 10:25:19 am »
Whoa, awesome! So how good does this compete against glib for example?

You should note that the screen is a 68K screen    It hasn't been writed for z80 yet.

Also, I did try that few year ago on z80, it worked, (1 portal bring down the whole scene to about 9 fps) but the main issue that I encounter is that the cliping is a very expensive method to use on z80 (that is, no div or mul command), and should be evited. But it is still definitly doable.

#### Duke "Tape" Eiyeron

• Urist McEiyolobster
• Super User
• Join Date: Nov 2014
• Location: (V)(-_(//));(V)
• Posts: 1636
• Post Rating Ratio: +11/-2
• Fanciest Walrus of the oceans.
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #13 on: June 27, 2015, 10:49:32 pm »
I'm amazed at the speed and the quality of the screenshot you gave us. 3D untextured solid? Collisions? Cinematics? Mazette!
• Calculators owned: A lot.

#### Snektron

• Lvl 69 Russian Snake
• CodeWalrus Staff
• Super User
• Topic Management
• Join Date: Dec 2014
• Location: Netherlands
• Posts: 3155
• Post Rating Ratio: +31/-0
• SSSssssss.....
• Gender:
##### Re: X3D - A 3D engine for TI68k Calculators
« Reply #14 on: June 28, 2015, 09:23:27 am »
Next thing you know someone made Assassins Creed Unity for calculators
• Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...

You can also use the following HTML or bulletin board code to share it on your page or forum signature!

Also do not forget to check our affiliates below.