Author Topic: Jims 3D Engine Source[BB2D]  (Read 4069 times)

0 Members and 1 Guest are viewing this topic.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Jims 3D Engine Source[BB2D]
« on: January 17, 2007 »
Originally Post from The Home Brew Forums By Jim Shaw.


Some of you have been asking for the source to my 3D engine. It got quite far but never got finished, largely due to ezboard messing up.

It supports:

3D Geometry with multiple models all with their own scale and orientation.
Full 3D clipping.
Flat and Gouraud shading.
Flat and Gouraud texture mapping.
Affine and non-affine texture mapping.
Z-Buffer and non-Z-Buffered.
Static, RWX, 3DS ASC and Milkshape model file loading.

It's relatively quick, though it'd be possible to squeeze out a little bit more if you switched to a wbuffer.

I really should have finished it off, but here's pretty much where it got to: 3D Engine

Edit: Now Fixed for wbuffer: 3D Engine with wbuffer

Enjoy!
Jim
« Last Edit: July 21, 2007 by Shockwave »
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Jims 3D Engine Source
« Reply #1 on: January 17, 2007 »
holy shit man... thats awsome... how long did it take to make that???   just awsome...
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Jims 3D Engine Source
« Reply #2 on: January 18, 2007 »
As you can see there's a lot of cut and pasting so it didn't take too long :).  The hardest part was the clipper.  Normally I do that iteratively, plane by plane, but without using pointers that's very hard, so I did it recursively. ???
The other thing I like about this is that I sacrifice an extra If check per pixel from the wbuffer to see if the colour pixel was written since the wbuffer was last cleared, meaning I don't have to WritePixelFast any unrendered pixels.  WPF is too slow in B2D.

Jim
Challenge Trophies Won:

Offline MrP

  • Atari ST
  • ***
  • Posts: 176
  • Karma: 18
    • View Profile
Re: Jims 3D Engine Source
« Reply #3 on: January 18, 2007 »
Im not going to say anything about that......... I'll just add some karma............ (for someone that is crap at maths and this 3d stuff, just be assured that respect has been issued where it needs to be)

Offline mike_g

  • Amiga 1200
  • ****
  • Posts: 435
  • Karma: 34
    • View Profile
Re: Jims 3D Engine Source
« Reply #4 on: January 18, 2007 »
There have been times when I sat around and wondered how a 3D engine could be coded. For a while this occured frequently but dident last long until I got bored of not knowing what I was trying to think about. Anyway from what I have seen here  is theres a fair bit of code in there packed with hardcore maths. You get karma for that jim ;D  Hopefully I will be able to begin to figure this stuff out some time. Much thanks for sharing the code.  :cheers: