PDA

View Full Version : Retrieving coordinates from vehicle side


SWEMike
16/01/2012, 08:58 PM
How do I retrieve coordinates for the side of a vehicle no matter what angle it has? I'm not very good with the advanced mathematical stuff yet.

sabretur
16/01/2012, 09:05 PM
Use floatsin(), floatcos().

SWEMike
16/01/2012, 09:06 PM
As I said, I'm not very good with advanced mathematics. I don't know the rest of the equation that I would need...

sabretur
16/01/2012, 09:12 PM
As I said, I'm not very good with advanced mathematics. I don't know the rest of the equation that I would need...

Okay, you aren't very good at maths, so I will try to explain:
To right side:
new Float:x,Float:y,Float:z;
new Float:distance = 10; // A distance to vehicle's side point
GetVehiclePos(vehicleid,x,y,z);
new Float:x1 = x + distance * floatsin(90 - angle,degrees);
new Float:y1 = y + distance * floatcos(90 - angle,degrees);
To left side:
new Float:x,Float:y,Float:z;
new Float:distance = 10; // A distance to vehicle's side point
GetVehiclePos(vehicleid,x,y,z);
new Float:x1 = x + distance * floatsin(270 - angle,degrees);
new Float:y1 = y + distance * floatcos(270 - angle,degrees);
I hope you understand this.

SWEMike
16/01/2012, 09:18 PM
Thank you! I'm not good at this kind of math yet. I'm in the electricity and energy program in school though and we have to learn trigonometry and stuff soon. I just wanted to defend my manhood. LOL Seriously, I will probably get the hang of it completely when I actually try to learn it. :)