Jump to content

Calculating position


DjSt3rios

Recommended Posts

Hello! (Looks like courteous people are a rare thing on this forum)

A much easier and more efficient way of doing this is with the element matrix:

  
local fMatrix = getElementMatrix( iVehicle ) 
  
-- Calculate a position that is 10 units (meters) in front of the vehicle's position. 
local X = fMatrix[4][1] + ( fMatrix[2][1] * 10 ) 
local Y = fMatrix[4][2] + ( fMatrix[2][2] * 10 ) 
local Z = fMatrix[4][3] + ( fMatrix[2][3] * 10 ) 
  

:)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...