# Java Graphics: Vehicle doing a turn

• 03-20-2012, 04:34 PM
garnaout
Java Graphics: Vehicle doing a turn
Let's say I have point A and point B separated by a distance d.

How can I move a certain object (a car per se) from A to B with a 45 degree turn? I have been working on a 3d game in Java and wrote most of the basic functions such as accelerate, decelerate, constant speed, etc but I am stuck at doing the turns.

can anyone give me a hint?

thanks
• 03-20-2012, 05:49 PM
Norm
Re: Java Graphics: Vehicle doing a turn
Can you explain what you are trying to do?
If a shape is being moved from A to B when does it change direction? When it gets to B? When it first leaves A?
Is the 45 deg change in direction to the left or right of the line from A to B?
Is the idea to get a new line of travel say A to C where the new line is a 45 deg change in direction from A-B?
Sounds like a trigonometry problem. Take a piece of paper and draw the lines and work out the formulas.
• 03-20-2012, 10:15 PM
DarrylBurke
Re: Java Graphics: Vehicle doing a turn
Haven't-a-clue questions don't belong in Advanced Java.

Moving to Java 2D

db