Jump to content

Drawing a 2D ontop of a car (3D positioning)


Recommended Posts

Hello, so far i tried some nasty things but with no succeed...

My first guess was something like this:

local _,_,rot = getElementRotation(veh2) 
local size = getElementRadius ( veh2 ) 
local x,y,z = getElementPosition(veh2) 
local nx,ny = getPointFromDistanceRotation(x,y,size*0.7,rot) 
local cx,cy,cz = getPositionFromElementOffset(veh2, nx,ny,z+size) 

This wasnt even close to work at all actually...

My second guess i thought it was closer (But actually just trying to get something to work at all), but it is somehow not working...

local x,y,z = getElementPosition(veh1) 
dxDrawRectangle3D( x, y,z+10,10, 10,tocolor(255,255,255,255)) 

Any help regarding to this would be appreciated.

My idea was to make the box appear just on top of the car as a podium, wich i couldnt achieve at all right now...

Visual failure:


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