Take a llok at
http://www.fastgraph.com/m
http://www.tutcity.com/tut
Both cover the maths and the programming backgound, and you will have a good time learning from these.
Main Topics
Browse All TopicsHello! Ive got a homework assignment for my game Dev. class, and the assignment is to find XYZ coordinates of the player (which I have now) then map out a path with the XYZ Coordinates, while writing the XYZ coordinates to a Config.ini file every .5 seconds for later use, So I have that part down pack, im able to record player movement through XYZ coords to an config.ini file, But now Im stuck at the last part of the project!
We have to take the recorded path coordinates we recorded and read from the .ini file, which isnt the the problem., my problem is player rotation! Im wondering how do you calculate which way the player would have to turn to goto a certain coordinate, (like a GPS points to a saved coordinate) So theres a 360 Degree rotation, and say the next coordinate the player needsw to walk to is X:-6381 Y: 471 Z: 378 (These are rounded to the closest integer) So how do I calculate which way or how much the player needs to rotate to move in that direction?!
Thanks so much in advance for the help, Im enjoying my stay here.
Also, Im programming this in AutoIT V3 Beta since its an open "Freestyle" project, But if someone knows how to do it in Visual Basic, C++ or C# ill understand any of those, doesnt need to be strictly an AutoIT answer, Thanks.
p.s, Ive heard it would be easier to use 180 Degree rotation for the calculation of player rotation.... Let me know your opinion. Thanks alot
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Take a llok at
http://www.fastgraph.com/m
http://www.tutcity.com/tut
Both cover the maths and the programming backgound, and you will have a good time learning from these.
well im not doing 3D programming or anything like that yet, Just making a third party program for the teachers game that he provided the whole class, it consist of a lil character toon guy, that can run around, jump, walk, etc, So i need to make a program that records the characters XYZ coordinates in an Config.ini file then make him run that path with the XYZ coords, Ive got him moving but he isnt rotating to the direction of the next coordinate... he is just running straight ahead... Sorry if you misunderstood me , ill read this links tho jkr, but im pretty sure ill be using PI conversions (3.14) / (180) but im not sure how to go about doing this correctly in AutoIT (which has some similar C++ syntax) or an explanation or code snippet in anouther language like C++, VB or C# I can understand...I always can learn alot better from a code sample....Let me know thanks guys
yes the game is 3D but im just trying to get the formula to use so the program can figure out wat direction to turn by the coordinates of his current position and the coordinates of the next waypoint to run to, just like a GPS points to the direction of a saved coordinate so if theres a 360 degree of possible output, I need the formula to figure out say if the current position of toon is [X is -2000, Y is -210, Z is 78 ] and the nexy waypoint is [X = -1000, Y = -310, Z = 42] Anyone know what the math formula is to figure that out? im sure theres a math problem that deals with this :p
It is not a plain formula, it is matrix algebra - check out the rotation matrices above, they will have the formulas for the individual coordinates as well. Also see http://en.wikipedia.org/wi
you say look at this tutorial but you didnt post any links..... isnt there a conversion to find the direction that a coordinate is in like north south east west?? you guys are making it seem so much harder then i feel it is! Thanks for the help so far and all, ive read those pages bbut they are dealing with making 3D worlds and camera rotation, I just need a plain formula just like a GPS uses to point in a north south east west my direction....it just seems like when i look at those tutorials they look like nothing my teacher was talking about, seems to advanced of 3D programming for the starting assignment....if anyone understands what i mean and could give me an answer, code snippet whatever anything! It doesnt have to be exact, just a way to find out whatdirection a set of XYZ coords is in. thanks
ooops sorry. i mean to post a link...
http://chortle.ccsu.edu/Ve
And I'm sorry, but there is no such thing as north, or south or whatever. Your resistence is futile!
You yourself said you have points in 3 space.. X, Y, and Z values.
Tell me, what's "North"?
In your euclidian space, (XYZ), which direction is negative X? which direction is positive Z?
-john
ok well theres a map in the game that shows which direction north south east west is just like our world has XYZ coordinates and N S E W, So if I get the coords from the very north of the map, then the coords from each point of the map (south, east, west) This will atleast tell me about where north is and show, then from there theres got to be an math equation to figure out which direction the next waypoint is cloest to! This makes perfect sense to me, Im just looking for an answer, Im not into vectors or programming a game I programming a small third party app that rotates the character with _MouseMovePlus() function and runs a path, this isnt the hard part of the class...hopfully you can understand what I mean....If you know some things about the situation theres always a way to figure it out, Since I know the game uses N S E W Im going to get those coords, Ill map my findings...hopflly i can do it myself...thanks i guess
That's not what I'm saying...
If you're on a standard X, Y grid (like a screen) then the coordinates usually go something like this:
0,0 at the top left 1024,0 (top right)
0,768 bottom left 1024,768 (bottom right)
So, do you really need to have your Z coordinate in your heading?
If not, then the math is really simple...
If my next point is to the left of me (x is less than my current x) then face left
if my next point is to the right of me (x is more than my current x) then face right
Like that...
Same with Y values... face up or down based on where you're heading.
Is that the sort of answer you're looking for?
-john
Business Accounts
Answer for Membership
by: jgordosPosted on 2009-01-30 at 07:32:30ID: 23509210
You don't really talk about your math background, so I'll start there...
have you done much with vectors?
-john