Jump to content

Moving images in a vehicle


Recommended Posts

Hello, I have played a server in which you can place a modification in a car, which is to put certain images in motion and I wanted to know what is needed to be able to create moving images in a car

Link to post


These are more or less the basic components for a not moving image, which can be enhanced with a moving image later on.



(order matters):



function getPositionFromElementOffset(element,offX,offY,offZ)
    local m = getElementMatrix ( element )  -- Get the matrix
    local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1]  -- Apply transform
    local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2]
    local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3]
    return x, y, z                               -- Return the transformed point


<function start>





x1, y1, z1 = getPositionFromElementOffset(vehicle, 0, 0, 0)

x2, y2, z2 = getPositionFromElementOffset(vehicle, 3, 0, 0)



<function end>






Edited by IIYAMA
Link to post

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