SGDK icon indicating copy to clipboard operation
SGDK copied to clipboard

Tutorials for working with 3D?

Open NaotoNTP opened this issue 6 years ago • 1 comments

I haven't seen any tutorials related to working with SGDK's 3D capabilities (rendering 3d shapes with the Bitmap engine and working with various Maths3D functions). I've tried taking a look at the built-in cube demo, but there are several things that the demo alone can't really address, especially with lack of detailed comments. I found myself asking questions like "So is that checkerboard dither pattern that appears on filled polygons something I can turn of or not?" and "Can I really only have a maximum of 256 points?" I feel like a tutorial or at the very least some proper documentation in the form of comments in the code would save anyone interested in wanting to work with the limited 3D capabilities a lot of time and frustration.

NaotoNTP avatar Jul 07 '17 23:07 NaotoNTP

All the methods are documented and honestly there is not much to say about the 3D part which is pretty minimal :p You should use maths3d unit for 3D transformation part and bitmap unit for drawing part. The checkboard dither is because you use plain 8 bits color, Bitmap mode use 1 palette and so is limited to 16 colors, still you have to possibility to provide 8 bits colors to the drawPolygon(..) method to enable dithering and simulate more colors. If you don't want it, just use plain 4 bits colors like this : 0x11, 0x22, 0x33... :) I can eventually do a better 3D sample example but still 3D capabilities are pretty limited as the Megadrive hardware is not designed for that.

Stephane-D avatar Jul 10 '17 13:07 Stephane-D