Well, it just goes to show you should never leave a bored coder to his own devices. No pun intended.
I wrote a 3d engine in two days. What makes this even cooler is that (1) it's my first 3d project ever, and (2) it's in BASIC. Cool.
This thing can plot points, wireframes, and polygons based on the x,y,z point coordinates and polygon lists located in certain lists. I'll post more info (mainly a link to the package) later, but my time is rather crunched. BTW, it does also do a bit of crude polygon sorting, and points for the models should be arranged in a clockwise manner to be viewed. There are some mild issues (like mainly the view is flipped on the Y axis) but other than that it looks pretty good for a calc. I hope to use the experience and knowledge to put the engine to use in an asm project, and in a really cool GBA project.
I do have a screen showing polygon filling:
-gamefreak
Comments welcome.
3d Engine
Moderator: MaxCoderz Staff
- thegamefreak0134
- Extreme Poster
- Posts: 455
- Joined: Mon 23 Jan, 2006 10:09 pm
- Location: In front of a Computer, coding
- Contact:
-
- Regular Member
- Posts: 76
- Joined: Sun 13 Nov, 2005 2:42 am
- Location: A cold cold land filled with snow
- Contact:
That looks great. I hope we get to see it in action soon.
Wright Studios.org the place for calculator graphics.
- thegamefreak0134
- Extreme Poster
- Posts: 455
- Joined: Mon 23 Jan, 2006 10:09 pm
- Location: In front of a Computer, coding
- Contact:
Um.. well... this is basic, so that should say something. On my 83+SE, it can render the ablve frame it about 30 seconds. Not bad considering that this is BASIC, and considering that I have done no optimization of any kind. However, since it has to do the fill-in the polygons thing, the basic version may just have to remain slow. The engine could be ported to asm easily, but I need to either brush up on the floating point math handling or find a way to render it in fixed point. That's not hard on a gameboy, but this is an 8-bit processor, no? I don't think I can get the needed accuracy unless I can at least do 16-bit math operations, which are unfortunately quite limited. I could of course fake that by handling the separate parts individualy... But enough about that.
Glad to see it was taken well. Once I put it all together in one program (not hard) I'll go ahead and post it.
-gamefreak
Glad to see it was taken well. Once I put it all together in one program (not hard) I'll go ahead and post it.
-gamefreak
- benryves
- Maxcoderz Staff
- Posts: 3087
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Game Boy or TI-8x, 8-bit or 128-bit, fixed point ideas remain the same.
My 3D engine (and another one based on points I did for the Game Gear, also Z80) use a mixture of 8, 16, 24 and 32 (!) bit fixed-point arithmetic, usually to the extent of 8.8, 16.8 and 16.16 splits.
This site could be useful. I'm using slightly modified versions of their routines to handle signed multiplication/divisions.
Floating point is probably not a good idea for realtime on our puny calcs.
My 3D engine (and another one based on points I did for the Game Gear, also Z80) use a mixture of 8, 16, 24 and 32 (!) bit fixed-point arithmetic, usually to the extent of 8.8, 16.8 and 16.16 splits.
This site could be useful. I'm using slightly modified versions of their routines to handle signed multiplication/divisions.
Floating point is probably not a good idea for realtime on our puny calcs.