What is a graphics engine?

Ok just what is a graphics engine? i am very good at making algorithms to describe what happens to something or calculating various things that would happen in a game but i am completely clueless when it comes to graphics.

Does a graphics engine take care of actually displaying my stuff on screen? In other words I tell it the objects location in 3d space, its direction, and it takes care of the actually displaying the scene.

How do I determine what was clicked? In business programming I double click the control and it brings up the event handler for the control. In a game environment do I have to calculate based off of mouse position what was clicked.

If I do have to calculate mouse position do i loop through everything that is on the screen to see if the point clicked was within it?

Collision detection: What is the standard way of doing this? Do people do a dual layer process? In other words do people first try to detect a collision based off of spheres first (Radius to center point is easy) and then a more complicated algorithm for more complex shapes.

How do you do complicated three dimensional models? Like landing gear moving down from an aircraft. A turret moving on a battleship.

I am primarly interested in strategy games which can be very good in a 2d game environment but I would like to make them look 3d.

Thanks for any help you can give me. i know it is alot but i don't know any people familiar with the game development industry to ask. I only know business programmers.

[1561 byte] By [DanScan] at [2007-12-31]
# 1
Not sure I'm qualified to answer most those questions, but I know of a decent paper on collision detection.

http://www.peroxide.dk/papers/collision/collision.pdf

As far as what a graphics engine is I suggest you learn DirectX9c. A decent tutorial is:

http://www.c-unit.com/tutorials/directx/

I find reading a book the best way to learn so I recommend searching "Introduction to 3D Game Programming with Direct X 9.0c: A Shader Approach" under amazon.com

jony at 2007-9-6 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2

DanScan wrote:
Ok just what is a graphics engine?
There isn't a single correct answer to this - ask 10 people and you'll likely get 10 different answers

Broadly speaking it should be an abstraction of the rendering process - manages the data that is being viewed and the process involved in getting that information on the screen.

Direct3D nor OpenGL are engines - they are API's, an engine would be the code that sits on top of these API's and abstracts it away for the application developer. It would be customized so as to offer services that a specific class of application might want - a strategy game engine is likely to be different to one that a FPS needs.

DanScan wrote:
Does a graphics engine take care of actually displaying my stuff on screen? In other words I tell it the objects location in 3d space, its direction, and it takes care of the actually displaying the scene.
Yes - it will be the interface between the logic in the application and the underlying API (Direct3D) that actually does the rendering. It's job would be to ensure the pipeline is configured correctly, resources are loaded and that the appropriate calls are made to do the work. Often a big part of graphics engines is taking what the application requests and re-ordering it to be as optimal as possible.

DanScan wrote:
How do I determine what was clicked? In business programming I double click the control and it brings up the event handler for the control. In a game environment do I have to calculate based off of mouse position what was clicked.
It is a lot more involved than any business software. There are various utility functions that can help but ultimately you must do the reverse transformation from screen-space to object-space - lots of lovely mathematics!

DanScan wrote:
If I do have to calculate mouse position do i loop through everything that is on the screen to see if the point clicked was within it?
A 2D coordinate for the mouse translates to a 3D ray which could intersect with many objects (or even the same object multiple times). You can either trace along the ray for the first intersection or you can check all objects and then sort all those that intersect based on distance and pick only the object closest to the camera.

DanScan wrote:
Collision detection: What is the standard way of doing this? Do people do a dual layer process? In other words do people first try to detect a collision based off of spheres first (Radius to center point is easy) and then a more complicated algorithm for more complex shapes.
Firstly, collision detection is physics not graphics and you probably don't want it to feature in a proper graphics engine. You get lots of people thinking that they all fit together, but there is a natural seperation between them (I like to think of it in terms of the "model-viewer" pattern).

Your "dual layer" is more commonly referred to as heirarchical. Yes, it is *very* common to do this - early/simple/cheap rejection tests are a very powerful optimization. Heirarchical approaches can allow you to eliminate huge amounts of work very easily.

DanScan wrote:
How do you do complicated three dimensional models? Like landing gear moving down from an aircraft. A turret moving on a battleship.
You use a 3D modelling package (free ones include 'Blender' and 'Wings3D', pricey ones include 'Maya' and '3dsmax') to create the source data - procedural content is becoming more common but for the most part you wouldn't want to write code to generate these sorts of models. This is where artists tend to fit into the equation...

DanScan wrote:
I know it is alot but i don't know any people familiar with the game development industry to ask. I only know business programmers.
The popularity of games is starting to have a knock-on effect with the number of books on the subject - the concepts of engine design being particularly popular. GameDev.net has a large catalog of books that you might want to read through.

If you're new to this then I'd highly recommend looking at XNA Game Studio Express (hit Beta-2 the other day, possibly going final on December 11th from what I've read). I've not used it myself, but it should be perfect for you to get used to the concepts of game development without getting bogged down in too many technical details. Often the concepts rather than the implementation is the key part...

hth
Jack

JackHoxley at 2007-9-6 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 3

3D graphics engine as opposed to low level library (i.e. OpenGL, DirectX) is something that will let you to program with high level abstractions, rather than low level primitives. This will save 80-90% of your time to make a program to render the scene you might need.

Something like interactive 3D fly-by supported graphics can be done with 6-7 calls to engine, while it will take 2-3 thouthands lines of calls to library.
http://www.sciencegl.com/Stock_market/Stock_market.htm

Nick111 at 2007-9-6 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...