DjSt3rios Posted January 26, 2013 Share Posted January 26, 2013 Hello. I need some help. I would like to calculate the position in front of the player's vehicle. I tried a few things but nothing seems to work. Do you have any idea how to do that? Link to comment
Castillo Posted January 26, 2013 Share Posted January 26, 2013 viewtopic.php?f=91&t=34239&p=356668 Link to comment
guix Posted January 28, 2013 Share Posted January 28, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now