Simple 3D Software Renderer for starters

Everything related to 3D programming
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Simple 3D Software Renderer for starters

Post 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!
Last edited by jamirokwai on Thu Dec 02, 2021 12:10 pm, edited 1 time in total.
Regards,
JamiroKwai
User avatar
spikey
Enthusiast
Enthusiast
Posts: 581
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Simple 3D for starters?

Post 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
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Simple 3D for starters?

Post 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... :-)
Regards,
JamiroKwai
User avatar
StarBootics
Addict
Addict
Posts: 984
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Simple 3D for starters?

Post 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
The Stone Age did not end due to a shortage of stones !
User avatar
captain_skank
Enthusiast
Enthusiast
Posts: 636
Joined: Fri Oct 06, 2006 3:57 pm
Location: England

Re: Simple 3D for starters?

Post 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 :)
ricardo_sdl
Enthusiast
Enthusiast
Posts: 109
Joined: Sat Sep 21, 2019 4:24 pm

Re: Simple 3D for starters?

Post by ricardo_sdl »

You can check my games at:
https://ricardo-sdl.itch.io/
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Simple 3D for starters?

Post 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.
Regards,
JamiroKwai
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Simple 3D for starters?

Post by Demivec »

jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Simple 3D for starters?

Post 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 :-)
Regards,
JamiroKwai
User avatar
StarBootics
Addict
Addict
Posts: 984
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Simple 3D for starters?

Post 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
The Stone Age did not end due to a shortage of stones !
MrBean
User
User
Posts: 17
Joined: Sat Dec 22, 2012 7:27 am

Re: Simple 3D for starters?

Post 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
Bitblazer
Enthusiast
Enthusiast
Posts: 733
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Simple 3D for starters?

Post 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.
webpage - discord chat links -> purebasic GPT4All
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Simple 3D for starters?

Post 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!
Regards,
JamiroKwai
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Simple 3D for starters?

Post 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!
Regards,
JamiroKwai
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Simple 3D for starters?

Post 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
Post Reply