"rotate 50º to the right and go straight till you reach the finish!"
In three-dee, you can rotate a player, but how will you know what is straight ahead after you do that?
You got position coordinates for every obstacle,
so just check whether the coordinates match your view or not, badabingbadabum.
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
[edited by - Bill Cosby on July 29, 2002 4:36:33 AM]
so just check whether the coordinates match your view or not, badabingbadabum.
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
[edited by - Bill Cosby on July 29, 2002 4:36:33 AM]
for(;P("n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
like in a racegame, the player turns right, not the world, so if the player moves straight ahead, which cordinate must be ++?
cuz normally thats the Z coordinate, but in this case, the world doesnt move, just the player.
cuz normally thats the Z coordinate, but in this case, the world doesnt move, just the player.
You need to learn vector mathematics
Basically you have a "forward" vector, which is what you rotate when the car turns. Then, if you want to move ahead n units, you simply scalar-multiply your "forward" vector by n and add it to the current position. This is assuming your "forward" vector is normalized, which is usually the case in these matters.
Basically you have a "forward" vector, which is what you rotate when the car turns. Then, if you want to move ahead n units, you simply scalar-multiply your "forward" vector by n and add it to the current position. This is assuming your "forward" vector is normalized, which is usually the case in these matters.
If I had my way, I''d have all of you shot! codeka.com - Just click it.
quote: Original post by Pipo DeClown
like in a racegame, the player turns right, not the world, so if the player moves straight ahead, which cordinate must be ++?
cuz normally thats the Z coordinate, but in this case, the world doesnt move, just the player.
I think this is the most common mistake, you can''t move your screen, can you? so you got to move the world.
Therefor are the matrices and vectors calculations.
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
for(;P("n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
Well, I thought like, stick the camera to the character, and then when the character moves forward, the viewmatrix does too.
ok, you look at your screen, you see a box, you move ahead, so what''s happening, the box approaches and you don''t, ''cause you are stuck on your seat.
It''s impossible to move your viewmatrix like this or it''s even more complicated and serves no purpose, I guess
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
It''s impossible to move your viewmatrix like this or it''s even more complicated and serves no purpose, I guess
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
for(;P("n"),R--;P("|"))for(e=C;e--;P("_")+(*u++/8)%2))P("| "+(*u/4)%2);
I find it more convenient to think about the camera as it''s own object with position and direction and just leave the "move the entire world" bit until the point where you calculate the view matrix (i.e. at the end). It''s no more computationally expensive, and it''s much closer to the way I think about things...
If I had my way, I''d have all of you shot! codeka.com - Just click it.
quote: Original post by Dean Harding
I find it more convenient to think about the camera as it''s own object with position and direction and just leave the "move the entire world" bit until the point where you calculate the view matrix (i.e. at the end). It''s no more computationally expensive, and it''s much closer to the way I think about things...
Yes indeed, and in a multiplayer or split screen game "move the world" way isn''t correct anymore because then the world would have to move in different directios at the same time for the two cameras
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement