Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Urgent Question about Angle and Vector

Author
Message
Dark Gamers
16
Years of Service
User Offline
Joined: 17th Mar 2008
Location:
Posted: 29th Jul 2008 00:00
Hello, the following code is programmed by Tolk, and I need your help to settle the angle problem.

The code shows a capture a mouse clicking and the player is driven to the direction of mouse clicking position immediately.



The last few code compute the direction the player should face.

Assuming the player is now moving in the direction of V(origin), the question is:

when I click the mouse, instead of driving the player simply with the mouse clicking direction, we let it move in the direction of the vector sum of V(new) and V(origin) for the time duration 100ms. After that, we set the motion of the player to move in the direction of V(new).

As the figure shown, P0 is the mouse clicking position; the green line is the sum of V(new) and V(origin); the red line is the motion path of the player when 100ms expired.

How can I program the code as described above? Better be based on the listed code or any new ideas will be fine.

I'd really appreciate it!!

Attachments

Login to view attachments
Dark Gamers
16
Years of Service
User Offline
Joined: 17th Mar 2008
Location:
Posted: 8th Aug 2008 20:11
Can anyone help? Thanx

Login to post a reply

Server time is: 2024-11-20 17:25:16
Your offset time is: 2024-11-20 17:25:16