# Thread: Java Graphics: Vehicle doing a turn

1. Member
Join Date
Sep 2011
Posts
17
Rep Power
0

## 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

2. ## 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.

3. ## Re: Java Graphics: Vehicle doing a turn

Haven't-a-clue questions don't belong in Advanced Java.

Moving to Java 2D

db

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•