Archived

This topic is now archived and is closed to further replies.

3d engines, or engines in general

This topic is 5245 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im pretty new to programming, and i was just wondering what elements make up a 3d engine. i know that is probably a little vague, or too general for engines, but if it provides me with even a general idea of their setup, then it will be considered great help. thanks in advance, its appreciated! Auxil

Share this post


Link to post
Share on other sites
My answer will be as vague as your question. As you said - the engines CAN look different but of course there are some ground rules for the design of a 3D-engine.

You could look at it as this:
The reason for the engine to exist is to help you make a game faster through reuse of components and code.
Then we need to create an abstract engine that can be used in several games, of course in the same game-domain.

You can think of a world like the real world for example where you have entitys that are static and entitys that non-static e.g. a moving person.
The static objects are for example houses and trees.
So what we need is an class / module that handles the objects.
Besides the entitys we have the natural phenomenas like lights, fog and reflection. Theese modules have to created as well. For example a lightning-module / class.
So what you do is you litteraly create a component-model for each and everyone of the different entitys and phenomenas.
Next we define the realationship between the modules.
What we do is that we create a wrapper around theese modules. The reasons is because we want to simplify the use of the modules.
In a scene we want to be able to create a set of entitys and effects and then perform the game-related stuff like running around and so on. Lastly we want to render the scene using our wrapper for e.g. DX or OGL.

Example; The simplified dataflow from the HDD to a model on the screen.
1. Objectdata - stored on the HDD.
2. A loader for the object-data loads the data into a structure that can be used in the object-class.
3. The object-class - used to e.g. transform / move the object and so on.
4. The renderer - Renders the objectdata from the object-class at the position where the object is.

Blah!
Dont think this is want you want to know though!
Continue the thread and I will explain in more detail. Maybe even with a conceptual model in graphics. =O)

/R.

Share this post


Link to post
Share on other sites
Actually that helped a lot, haha. Unless i fail to grasp the concept, the engine basically defines each object''s(entitys) properties, and how it affects/is affected by every other object. An object and its properties are created then stored on the HDD, then loaded into the engine, where they are run and perform their function(s) and relations to other objects, and wrapped and rendered. maybe if someone could post a link to an example i could see(nothing too over my head, which probably rules out most everything), and possibly get a better understanding. we''ll see any more detail that you feel would help will again be much appreciated thanks!

Share this post


Link to post
Share on other sites
An entire 3D engine would encompass more than just rendering models and moving them around, and it''s possible to make an engine that could be used on more than one type of game - if not all of them.

Generally, a 3D engine is made of of a number of sub-sytems, something like:
Input
Audio
Graphics
User Interface
Physics
Game Logic
Game Data


Only the last two of which are different between games or genres.

Collision detection runs the game - it is needed in every sub-system. You CD the viewing frustrum with the scene graph to determine what to render. You CD a sphere to determine what is audiable (or perhaps more complex CD is need for proper attunation, i.e. a door is in the way so it''s quiter). You CD every dynamic object (one that can move) against everything else to see if it''s hit anything, and feed that to the physics engine to determine the results. If the user clicks on screen, you CD a line (or ray) against the scene graph to find out what they clicked on. If you had a networking system, you could use CD to determine what data you need to send to who.

So the root of the 3D engine is the scene graph, and it''s primary job is to cull nodes for collision detection.

Magmai Kai Holmlor
- Not For Rent

Share this post


Link to post
Share on other sites
My question is...what is stored in the scene graph? Like for instance would it keep up with the entities,quadtrees,lights,etc. Would you then would have a render function that would render the scene graph? Is it the scene graphs job to do the culling or is it the renderer?

Basicly what i am asking does the scene graph just hold all the data for the scene?

[edited by - starboarder on August 7, 2003 11:27:38 PM]

Share this post


Link to post
Share on other sites