A couple of game related programming questions...
Hi everybody!
I got a few questions that someone maybe can help me with...
- What is the advantages/disadvantages with using matrixes?
- If I got a very complex "if" "else" nested code how could I make a more effiecient and readable, and make it easier checking for all possibilities?
I appreciate all help and tips I can get
/Zeb
Matrices are supposed to be somewhat fast. They also are supposed to make things neater, but I personally find them a pain in the butt to learn.
As for the ''if'' ''else'' thing, the only way I could think to make things a little more readable is if you indent for every nested statement.
As for the ''if'' ''else'' thing, the only way I could think to make things a little more readable is if you indent for every nested statement.
When thinking a little bit more.. I meant the advantages/disadvantage of using matrice multiplication.
Thankful for all help I can get
/Zeb
Thankful for all help I can get
/Zeb
well when it comes to matrix multiplication the way i understand it, is that it''s suposed to be easier than doing it the long way.
and about the if else statement i found that you can ditch a ton of elseif''s or at least improve read ability by useing a switch statement.
Don't take life too seriously, you''ll never get out of it alive. -Bugs Bunny
and about the if else statement i found that you can ditch a ton of elseif''s or at least improve read ability by useing a switch statement.
Don't take life too seriously, you''ll never get out of it alive. -Bugs Bunny
-------------------------------------------------Don't take life too seriously, you''ll never get out of it alive. -Bugs Bunny
Okay, so matrices are meant to be faster hey. Faster than what? what are they actually used for?
wise_guy
wise_guy
Matrices are faster than doing the actual calculation yourself (Using an equasion).
Matrices are used for everything, Rotation, Scaling, Translation.
The road to success is always under construction
Matrices are used for everything, Rotation, Scaling, Translation.
The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction
1. Keep in mind that matrices are nothing more than a way to group and relate a set of numbers. You could do everything you do WITH matrices WITHOUT them - it would just be very complicated to describe and keep track of.
2. This is oversimplified, but basically the primary advantage of matrices is that, first, they allow you to represent the transformation and rotations which are required to ''place'' an object as a conceptually ''single'' operation. Second, and more importantly, they allow you to combine multiple transformation and rotation steps into one, thus greatly reducing the number of calculations that must be done on each scene.
3. The primary disadvantage of matrices is that they can be damned hard to learn.
"I've upped my standards; up yours"
2. This is oversimplified, but basically the primary advantage of matrices is that, first, they allow you to represent the transformation and rotations which are required to ''place'' an object as a conceptually ''single'' operation. Second, and more importantly, they allow you to combine multiple transformation and rotation steps into one, thus greatly reducing the number of calculations that must be done on each scene.
3. The primary disadvantage of matrices is that they can be damned hard to learn.
"I've upped my standards; up yours"
"It's obvious isn't it Miller? Curiosity killed these cats!"
The problem with switch is that you cant use it with strings... only integral types. I''ve heard someone suggest enumerating the strings, but when the number of strings is dynamic, how would you put something like that together? If someone can come up with a good one for this, it will solve a huge problem in one of my apps, AND I will be their best friend.
There is no spoon.
ITs basically impossible without the use of a hack, because switches can only accept const cases
-----------------------------
A wise man once said "A person with half a clue is more dangerous than a person with or without one."
-----------------------------
A wise man once said "A person with half a clue is more dangerous than a person with or without one."
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
September 07, 2000 04:28 PM
Just put some of the pieces of your complex if statement into other functions. Mark the functions as inline or just use a macro if you''re worried about the function call overhead.
-Mike
-Mike
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement