3D optimization
I came across the formulas for 3d rotation while looking through an article by Chris Hargrove, here at Gamedev. He said that they could be optimized by cutting it down to a total of nine rotations for x,y, and z rotations.
NewY = (OldY*Cos(ThetaX)) - (OldZ*Sin(ThetaX)) NewZ = (OldZ*Cos(ThetaX)) + (OldY*Sin(ThetaX))
(Copy NewY and NewZ into OldY and OldZ)
The only way I could think to make this faster is to precalculate the cosine for ThetaX, and the sine for ThetaX, store them in seperate variables, and then call them up when you want to multiply them by the oldY or oldX.
Another problem I ran into...
How can I calculate large, open areas, and smooth ground?
I saw a movie for a game called Halo. It is still in the experimental stages, but it looks real good. The ground seemed real smooth, but it still looked like it had been done with a regular 3d engine (not a voxel engine).
To make the ground seem that smooth, i am guessing they had to push it to the 1000 poly mark. How could they do this?
You can get smooth landscapes by creating a matrix of hight values. Then, you treat each square formed by four ajoining vertices as a quad-polygon.
Using the matrix of hight values will take away the need for a sorting algorithm or z-buffer because you know where every polygon is already.
Then, to give is a smooth look, use gouraud shading (preferabley perspective correct gouraud shading, since the player needs to have acurate depth cues of the landscape.
Using the matrix-hight field method also makes collision detection between the ground and other objects much faster then just defining the ground as a normal object.
Using the matrix of hight values will take away the need for a sorting algorithm or z-buffer because you know where every polygon is already.
Then, to give is a smooth look, use gouraud shading (preferabley perspective correct gouraud shading, since the player needs to have acurate depth cues of the landscape.
Using the matrix-hight field method also makes collision detection between the ground and other objects much faster then just defining the ground as a normal object.
Thanks. I figured there had to be a better way. Was I right about the 3D rotation optimization?
I am just learning to do 3D. I am still quite fuzzy on matrixes, but i think i will figure things out eventually.
I am just learning to do 3D. I am still quite fuzzy on matrixes, but i think i will figure things out eventually.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement