kryton9
12-07-2010, 05:49
I was working on some stuff and abandoned it. I thought I would put it up here to help others. I know this stuff, boggled my mind and getting this to work felt good and could help someone interested in this stuff.
There are 3 files, one was going to be a part of lessons on 3D programming. The one included in the 9th, calculating normals.
The next two are terrain files. It reads raw greyscale file and makes a terrain from it. The one that creates bogus normals( Normals are used for light calculations to get the lighting correct). What is funny, is the bogus normals are brighter and look better than the one with normals calculated( This is because there is only one light and it moves with the camera).
The third file is, well you guess it, terrain with normals. It takes the 3 vertices of the face and finds the average normal per face.
All the keyboard commands are in the window title bars. The mouse is not used. Escape in all three programs will exit the program.
In the terrain apps, using a combo or up arrow and left arrow will make you go straight. You will get the hang of it once you start out like that. Back arrow and right arrow will bring you straight back. A/Z raises and lowers the camera so you can adjust your height as you move around the terrain.
In the normal terrain example, additional keys to rotate the camera so you can see the lighting better as you move around. S/X rot the camera up and down. C/V rot that camera left and right.
If you use both hands, right on the arrows and the left on the other keys, it works out pretty well.
There are 3 files, one was going to be a part of lessons on 3D programming. The one included in the 9th, calculating normals.
The next two are terrain files. It reads raw greyscale file and makes a terrain from it. The one that creates bogus normals( Normals are used for light calculations to get the lighting correct). What is funny, is the bogus normals are brighter and look better than the one with normals calculated( This is because there is only one light and it moves with the camera).
The third file is, well you guess it, terrain with normals. It takes the 3 vertices of the face and finds the average normal per face.
All the keyboard commands are in the window title bars. The mouse is not used. Escape in all three programs will exit the program.
In the terrain apps, using a combo or up arrow and left arrow will make you go straight. You will get the hang of it once you start out like that. Back arrow and right arrow will bring you straight back. A/Z raises and lowers the camera so you can adjust your height as you move around the terrain.
In the normal terrain example, additional keys to rotate the camera so you can see the lighting better as you move around. S/X rot the camera up and down. C/V rot that camera left and right.
If you use both hands, right on the arrows and the left on the other keys, it works out pretty well.