As I was sitting there ... in my room, holding a paper with a few ways how to track two objects, after a collision, ... thinking how to do that, I finaly got my self to tidy up my code a little bit.
I alwasy had problems with the draw. You know. Every model that you want on screen wants to be in that part, sometimes it even want its own draw code that tell the game how to draw them!
And when you use a new model or replace an old, it take hours just to find that one line that you have to change, or find the right place for the new one.
There you can document, split in regions what ever you want, it always stays a bunch on code. So I just made that what I always make.
I exported some parts of it into another file.
Just a few seconds later I got my DrawCode class which held its first code, a few minutes more I got all 5 codes, in the right order, documented and perfect!
I still got that big bunch of code, like the loop for the asteroids and planets, but thats all documented now! All I need now, if I want to draw a model is just load that model, create a Matrix holding the position/rotation/etc, and just call DrawCode.Model(Model, Matrix) and done!
I know that pros, got a much better way of doing that, that they only need a model, a matrix and a twinkle, and they got the model with the right spectral values, a costum textur, self-shadowing, fairys all around it, shadows from other stuff on it, AA, normal mapping and a little bit of bloom to make it Look. Lust. Great!
... I made a salto soon after I got my first model displayed ...
Greg the Mad
Tuesday, February 19, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment