Public Group

Archived

This topic is now archived and is closed to further replies.

"rotate 50º to the right and go straight till you reach the finish!"

This topic is 5982 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

In three-dee, you can rotate a player, but how will you know what is straight ahead after you do that?

Share on other sites
You got position coordinates for every obstacle,

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]

Share on other sites
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.

Share on other sites
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.

If I had my way, I''d have all of you shot!

codeka.com - Just click it.

Share on other sites
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);

Share on other sites
Well, I thought like, stick the camera to the character, and then when the character moves forward, the viewmatrix does too.

Share on other sites
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);

Share on other sites
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.

Share on other sites
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

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 11
• 26
• 10
• 11
• 9
• Forum Statistics

• Total Topics
633722
• Total Posts
3013540
×