Members - Reputation: 116
Posted 18 May 2012 - 03:50 AM
Now.. I'm kind of lost. I don't quite understand how I can now have my player model interact with terrain (i.e. don't let the player walk right through the model of the wall lol). I'm not sure how / what lighting/shading are.. and I don't even know what I don't know from that point.
So if you could, point me in the right direction with info / links please~ thank you.
Crossbones+ - Reputation: 4236
Posted 18 May 2012 - 05:56 AM
Members - Reputation: 565
Posted 18 May 2012 - 12:55 PM
The simplest form would be to consider a point where the characters feet are and how (when the character moves) the two places this point moves between form a line. From there, line vs polygon intersection tests will detect the collision and help you figure out how to correct. This is very basic...you'll partially clip through walls, floors and there’ll be a whole load of other problems but it’s simple and outlines simple principles that a more advanced solution solves on a larger scale.
A more elaborate implementation would be something like http://www.paulnettl..._Ellipsoids.pdf which would take you to a more advanced level without things getting too complex. Again, this would be somewhat representative of a common technique used in games and and I once put this exact thing into a PS2 game.
But I don’t bring this up for the purposes of a history lesson, its more the case that I think this paper describes a number of concepts and considerations that you might be interested in. Certainly if you read that paper you’ll begin to get a greater understanding of the many things involved with moving a character around and you'll begin to appreciate many small concepts that are still relevant in even more advanced solutions.
As for that more advanced solution…most people do solve this via general purpose physics engines nowadays. You can author your own but libraries like bullet physics might also interest you if you don’t want to do that.
Edited by freakchild, 18 May 2012 - 01:37 PM.
Members - Reputation: 565
Posted 18 May 2012 - 01:19 PM
In my own words generally shading is the variation and/or coloring of pixels. If you took some coloring pens and filled in a picture with color, you would be shading it. In the computer graphics sense though, it really means working out which pens/colors to use according to calculations or techniques that would be based on the physical properties in the scene or special visual effects. Some of those calculations might include considering the position and features of lights and coloring those pixels as if they were being lit by those lights …that’s what lighting is. There are many ways to do lighting and many different techniques.
Some people might argue that shading is to do with authoring ‘shader programs’. It is…but given that we also did shading before the concept of shader programs existed its more to do with the techniques and methods that we use to make scenes look more realistic or unrealistic, depending on the desired effect.
You can see a lot of different basic types of shading effects @ http://www.paulsproj.../projects1.html under the open gl projects topics. Note that some of these involve lighting.
If you want to get started in lighting, then bear in mind that by texturing you’ve already taken the first steps of what is known as lighting via a diffuse texture. The next steps would likely be learning about directional light (which is more of an effect than anything that exists in real life) and positional lights and figuring out how to account for them in your scene.
It’s an older reference, but I’ve always found the Cg book lighting chapter http://developer.nvidia.com/node/88 to be one of the best descriptions of the very basic lighting techniques and equations. The book in itself is a good reference for much of the basics involved in lighting and authoring shader programs, which you'll need to know if you want to tread this path.
Edited by freakchild, 18 May 2012 - 01:22 PM.