Page 1 of 2

Simple 3D Software Renderer for starters

Posted: Tue Nov 23, 2021 7:33 am
by jamirokwai
Hi there,

I'd like to have a look into displaying 3D-objects for a game. But my Highschool maths from almost 30 years ago definitively left my brain :-)

So, can anyone point me in the right direction for a simple beginning?
I am thinking about some simple primitives rotating, like a cube or a pyramid. First wireframe, later filled and shaded.

I don't want to use OGRE, but want to try bare metal - nothing special with ASM.

Thanks for your hints!

Re: Simple 3D for starters?

Posted: Tue Nov 23, 2021 7:07 pm
by spikey
I don't think there is such a thing as a simple 3D guide at that level! That's why there are such things as the OGRE library - they abstract a lot to make it easier to work with and do some (a lot) of the heavy lifting for you.

The first thing you'll need to do is refresh that highschool maths, and learn a bunch more too. This was a published book once upon a time and covers, for free, the important maths so that you'll understand the terminology in other resources. https://gamemath.com/book/intro.html

Re: Simple 3D for starters?

Posted: Tue Nov 23, 2021 8:23 pm
by jamirokwai
Hey Spikey,

thanks for the link. I will have a look.

To clarify: I won't be creating a full featured 3D-engine.
For a fresh start, I am just curious on how to map 3D-objects into 2D-space... :-)

Re: Simple 3D for starters?

Posted: Tue Nov 23, 2021 11:22 pm
by StarBootics
jamirokwai wrote: Tue Nov 23, 2021 8:23 pm To clarify: I won't be creating a full featured 3D-engine.
For a fresh start, I am just curious on how to map 3D-objects into 2D-space... :-)
If I may ask what libraries are you looking for ? DirectX, OpenGL ??? Which operating system are you on ?

Best regards
StarBootics

Re: Simple 3D for starters?

Posted: Wed Nov 24, 2021 11:53 am
by captain_skank
Whilst this book is very old and is specifically for coding on the ZX Spectrum, chapters 7 through 12 may be of use :

https://worldofspectrum.org/archive/boo ... x-spectrum

And you can download the PDF for free :)

Re: Simple 3D for starters?

Posted: Wed Nov 24, 2021 4:06 pm
by ricardo_sdl

Re: Simple 3D for starters?

Posted: Wed Nov 24, 2021 6:14 pm
by jamirokwai
Nice, thanks for the links. More to read :-)

@StarBootics
I am looking into bare metal. Should be cross platform as my main platform is macOS.
For a first try, I don't care about performance ^^

Many years ago, I had the German book "PC Underground". The authors were talking about wireframe, Gouraud-shading, and SB/GUS-programming with Pascal and Assembler... But I can't find a PDF of the book.

Re: Simple 3D for starters?

Posted: Wed Nov 24, 2021 6:43 pm
by Demivec

Re: Simple 3D for starters?

Posted: Thu Nov 25, 2021 10:38 am
by jamirokwai
Demivec wrote: Wed Nov 24, 2021 6:43 pm Ray tracing tutorial https://www.purebasic.fr/english/viewtopic.php?f=36&t=70251
Great, thanks! The maths should be somewhat similar, I assume :-)

Re: Simple 3D for starters?

Posted: Thu Nov 25, 2021 5:26 pm
by StarBootics
jamirokwai wrote: Wed Nov 24, 2021 6:14 pm @StarBootics
I am looking into bare metal. Should be cross platform as my main platform is macOS.
For a first try, I don't care about performance ^^

Many years ago, I had the German book "PC Underground". The authors were talking about wireframe, Gouraud-shading, and SB/GUS-programming with Pascal and Assembler... But I can't find a PDF of the book.
So a software renderer. interesting but I don't have any knowledge to share about that particular topic.

Best regards
StarBootics

Re: Simple 3D for starters?

Posted: Fri Nov 26, 2021 8:03 am
by MrBean
jamirokwai what is the "bare metal" ? a graphics engine ?, can't find it with google.
regarding the book "PC Underground" it is may be this one:
https://archive.org/details/pcundergrou ... e/mode/2up
can be viewed for one hour every time but after registering and installing the free "Adobe Digital Editions" and then you can browse the book for one hour, only one user in the whole world can browse the book at any time, when that user finish then another user can borrow and view the book for one hour. Unbelievable !!!
but the book software 43 Mb can be downloaded freely as ISO image file from
https://archive.org/details/PCUNDERGROUND
there is also a German version of the software
https://archive.org/details/pc-underground-cd-zum-buch

Re: Simple 3D for starters?

Posted: Fri Nov 26, 2021 8:55 am
by Bitblazer
jamirokwai wrote: Wed Nov 24, 2021 6:14 pm Nice, thanks for the links. More to read :-)

@StarBootics
I am looking into bare metal. Should be cross platform as my main platform is macOS.
For a first try, I don't care about performance ^^

Many years ago, I had the German book "PC Underground". The authors were talking about wireframe, Gouraud-shading, and SB/GUS-programming with Pascal and Assembler... But I can't find a PDF of the book.
The demoscene has a few tutorials and many sources regarding software 3d renderers. A great starting point is pouet but you can always ask google.

Re: Simple 3D for starters?

Posted: Fri Nov 26, 2021 6:54 pm
by jamirokwai
MrBean wrote: Fri Nov 26, 2021 8:03 amjamirokwai what is the "bare metal" ? a graphics engine ?, can't find it with google.
I heard this once from a fellow coder of mine. It means something like doing everything yourself. :-)
Have a look at the definition: https://en.wiktionary.org/wiki/bare_metal
MrBean wrote: Fri Nov 26, 2021 8:03 amregarding the book "PC Underground" it is may be this one:
https://archive.org/details/pcundergrou ... e/mode/2up
can be viewed for one hour every time but after registering and installing the free "Adobe Digital Editions" and then you can browse the book for one hour, only one user in the whole world can browse the book at any time, when that user finish then another user can borrow and view the book for one hour. Unbelievable !!!
but the book software 43 Mb can be downloaded freely as ISO image file from
https://archive.org/details/PCUNDERGROUND
there is also a German version of the software
https://archive.org/details/pc-underground-cd-zum-buch
Yeah, I found the ISO-image, but I like to read the written description again :-)
This is the book: https://www.booklooker.de/Bücher/Boris- ... y1W9M01ZZx
Actually, I just found a copy of the book for just 15 € plus shipping. Gonna take that one!

Re: Simple 3D for starters?

Posted: Fri Nov 26, 2021 7:05 pm
by jamirokwai
Just found this: http://rosettacode.org/wiki/Draw_a_rotating_cube

As I can read some JavaScript, I will have a look and convert it to PB :-)
I will get back to you all. Thanks again for your hints and links!

Re: Simple 3D for starters?

Posted: Fri Nov 26, 2021 7:08 pm
by #NULL
The NeHe OpenGL examples were ported to purebasic and just recently updated by mpz.

Open a window:
NeHe's OpenGL Framework (Lesson 1)
https://www.purebasic.fr/english/viewto ... 28#p576128

Draw some polygons:
NeHe's First Polygon Tutorial (Lesson 2)
https://www.purebasic.fr/english/viewto ... 29#p576129

Others:
https://www.purebasic.fr/english/search ... mit=Search