3D Engine Structure?

I want to create my own 3D Engine using OpenGL… but I can’t find any good information on how to setup everything… I want the engine to use classes and stuff… so far I have a class that creates a rendering contex in a window.

but then… how do I manage the rendering in a good way?

is it a good idea to create a Scene class that contains all objects, lights and a camera, that has a render function to render the whole scene at once after the collition detection, depth sorting, transparent Object sorting and so on…

there is a printed book available, called “OpenGL game programming”: this book is very useable.
If you don’t want to buy it (what i recommend to you) surf around the indernet and search after ebooks or other online articles, which describes the technology you need.
I’m sure, that there is a book outside in .PDF format, called “designing a 3D multiplayer game engine”; but i’m not sure, what the URL exactly was. use google…

The rendering is managed by your renderer class.
The physics is done by your …
Objects are in there …

and so on.

and eventually, you will have to break some OO concepts for reasons of efficiency and the people who advocate OO methodology so strongly will hunt you down and hang you.

DJSnow: do you mean the american book OpenGL programming that explain nothing but you already know ?? I don’t think this is a good book for making a 3D engine. The engine described is very poor, and all the things written are fairly available on the net…

don’t see an attack to you, that’s not my way of life.

Now, if you want to make your own engine, just start from the scrach: the less things you will discover, the best understood you’ll get later…

you could look at some 3D engines available (as little3D or nebula and so forth…).

see you on the road !

saian

Whether it’s good to have Scene class depends on what you want.
Best you can do to learn about how to write good engine is to look into some free engines somewhere in the net. However I must say it’s difficult to find more or less good and free OO 3d engine (have to look at Crystal Space), but I believe that making your app really OO actually saves you a lot of time you would otherwise loose tracking some nasty bugs…

at the bottem of page here http://uk.geocities.com/sloppyturds/kea/kea.html
ive written a simplified version of how the actual mesh rendering part of my engine is structured

Just a quick note, zed, your page has became totally unreadable on 800*600 thanks to those long comments in the code.

Anyway, there’s some interesting stuff there. Wonder where the mythical gotterdammerung page is.

-Ilkka

Are you interested only in the rendering part, or do you also want to simulate a world, camrea, actors, export data from modeling packages, script interactions, … ?

I’d recommend googling for “scene graph” for the former to give you some idea of ways to go.

Originally posted by jwatte:
[b]Are you interested only in the rendering part, or do you also want to simulate a world, camrea, actors, export data from modeling packages, script interactions, … ?
[b]

I’m intrested in all the parts… I want classes for world, camera, object and so on and then a render class that renders everything

I want to know how to manage textures, objects and lights.

I haven’t advertised delphi3d for several hours now, it’s getting about time. In the articles section there’s a whole series of articles concerning 3d engine developement. The quality varies a bit, but you’ll learn a lot from there.

The address is www.delphi3d.net

-Ilkka

Originally posted by JustHanging:
I haven’t advertised delphi3d for several hours now, it’s getting about time. In the articles section there’s a whole series of articles concerning 3d engine developement. The quality varies a bit, but you’ll learn a lot from there.

Thanks for pimping my site.

I’m not particularly proud of anything I did before the year 2001, though, so proceed at your own risk

– Tom

@saian:

mmh, no i mean the book (and this is the title) “OpenGL game programming”, written by AndreLaMothe, Dave Astle and other guys from gamedev.net (i think), i think it’s is published by a publishing house called “prima tech”, the URL of the book is http://glbook.gamedev.net/ - do you mean this book, saian ?

But, apart from which book you mean, you are right with your oppinion regarding this book (~the prima tech’s one):
This is book is really no “hardcore advanced prof.” book (as you might expect it from titles such as “realtime rendering”), but it describes the basics of OpenGL rendering and utilizing of 3D features in an easy-to-understand way - and the “owner” of this thread told us, that he want to start - so i thought this book could help him. And yes, you are again right: the engine is not the one which could Doom8 or Quake12 - but it is a base from which you can expand, learn and grow up.

>>american book OpenGL programming
mmh, i have never heard of a book called like this; please tell me, what is the exact title ?? (or is it this book what i mean??)

>>don’t see an attack to you, that’s not my
>>way of life.
no problem at all - the world is free… (oh yes, not all parts; i forgot )

>>“designing a 3D multiplayer game engine”
and this book, recommended by me, is available at the web as a series of .PDF files (each chapter) - but, as already said, i don’t know the URL - or do you mean this book, saian ??

>>explain nothing but you already know ??
if you are meaning the “OpenGL game programming” book, you are right, again: this book hasn’t taught me very much - because i was already at the “advanced level” when i bought it - but, all of us here can’t know at which level the author of this thread “McZ” is, so i though aiming at a beginner-level would be not wrong.

@ALL:
BTW: does anyone of you owns the book called “realtime shading” ?? (this one with the red “spinning top” on its title - it is sometimes shown here on GL.org on the mainpage)
If yes: is it good ? what is the content about ? (yes, realtime shading, i know for myself, but i mean more details on this book if anyone has it)

[This message has been edited by DJSnow (edited 02-07-2003).]

Originally posted by JustHanging:
[b]Wonder where the mythical gotterdammerung page is.

-Ilkka[/b]

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Nice to see that you are keeping it professional!
http://uk.geocities.com/sloppyturds/cv.html

Originally posted by PK:
Nice to see that you are keeping it professional!
http://uk.geocities.com/sloppyturds/cv.html

good enuf to join bodie + doyle u think?, naw mate theyll cramp my style.
note that site is old (im 32 now ), though still havent washed my hair since oktoberfest 1999 when i got piss all over it (not my own) sticky for a few days, oh funtimes

anyways for an engine i believe u must keep everything as seperate as possible

heres what i do

rendermanager // models textures glstates etc
scene // camera actors particlesystems etc
os // window input sound timer
game // hud menu options etc

personally i like to have each area knowing very little about other areas, ie everything is greatly independant

Originally posted by zed:
good enuf to join bodie + doyle u think?, naw mate theyll cramp my style.

Who?

Back to the original question. I think you need to get yourself some more general coding knowledge. Also, take a look at a bunch of engines already available out there. Random links: http://neoengine.sourceforge.net/ http://xengine.sourceforge.net/ http://nebuladevice.sourceforge.net/ http://crystal.sourceforge.net/drupal/ http://ogre.sourceforge.net/ http://www.addall.com/New/compare.cgi?isbn=0201633620 http://www.addall.com/New/compare.cgi?isbn=1558605932

I would recommend 3D Game Engine Design by David Eberly. Although it is crammed with math, so if you don’t like that, it might not be the best choise. And I’d suggest downloading the Quake II engine, if you already haven’t. It’s old, but it has the basic structure and since the basis of ogl doesn’t really change (hasn’t changed) it’s still a good reference. And I do think mister Carmack knows what he’s doing.

>>who?<<

>OK OK So I succumbed. I watched these two back when I was in college. Raymond Doyle is a nice tarty, curly headed cutie and William Andrew Philip Bodie is … well, you only need one of those to pull the plow. They have a very, very interesting relationship. Back in the day, it took me a couple of shows to catch on, but they spent more time with each other after their dates, than with the dates… If someone happens to look at Doyle the wrong way, Bodie grows fangs. And Doyle is none too tolerant of anyone messing with Bodie either. Its a bit more subtle thing than say … Starsky & Hutch… but there is definitely something there.

There is a lot of fun by play here as well as some really interesting plots. The boys have a good time with each other and even though our Raymond is a queen diva on occasion, Bodie still worships him. The bad part is that Doyle knows it. I also find it entertaining that they hate each other’s “girlfriends” and even their boss doesn’t find it odd that they live in each other’s pockets. There’s some very cute subtext dialog between them and there’s enough physical horsing around to make a slasher’s heart go all atwitter.

The best part of the show is the lovely lads in their tight pants (sorry, trousers). I would like to personally induct Bodie into the Black Tab Front Club. Oi, but he packs them tight. Then our Raymond in his spray painted jeans. A fine plush ass he displays too. Oddly enough Bodie seems to like it too. More than once you can see eyes straying towards it. And sometimes there’s goosing. I almost hurt myself when I caught the first occurrence of it. Entirely too funny! <
http://www.blacktauna.com/slash/pros.html

i havent seen it for 15years but it all starts to make sense

What!? =)
I think this is a bit OT

Use typical object oriented design approaches. Look for the nouns, like scene, object, terrain, model, camera, etc. and make classes out of them. Look for opportunites to use inheritance as well. Personally, I have all of my objects derived directly or indirectly from an Entity class, and all moving entities derived from a DynamicEntity class. This allows me to share positioning and physics code between all of my different types of objects. Hope this gives you some ideas.

And PixelDuck, the guy said he wants OO, so the LAST THING ON EARTH you should recommend is the q2 engine.

[This message has been edited by ioquan (edited 02-10-2003).]