![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
New Member
Join Date: Mar 2004
Posts: 9
|
When you load a heightmap in your game, some of you would want to be able to light it, but in order to have lighting, you must also have the vertex normals.
This method is simple, works by averaging the normals of all adjacent triangle normals Vertex declaration I'm using Code:
Normal calualation code: Code:
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jan 2003
Posts: 868
|
Ok i don't want to be rude but this is the third normal-calculating sample in a month!!!
|
|
|
|
|
|
#3 | |
|
New Member
Join Date: Mar 2004
Posts: 9
|
Quote:
this sample averages the normals of the adjacent triangles (which is partly wy it runs a little slow) and provides more accurate data, for lighting |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|