Jump to content

[Help] createMarker


Recommended Posts

Posted
You have to use DX functions, or just find similar object and create invisible marker on it.

No no. its not working like that because when im far a bit from the marker i see the normal one but when im near i see the one like on the pic ( getDistanceBetweenPoints3D ). i think i can change marker object with txd workshop ?

Posted

That's made with dxDrawLine3D. You have to use that in combination with mathematical calculations to make it work.

I suppose you could change the texture too, not sure.

Posted (edited)

To even begin using the function, you need to render it like so.

local position = { 
    startX = 0, -- x coordinate of the start position 
    startY = 0, -- y coordinate of the start position 
    startZ = 4, -- z coordinate of the start position 
    endX = 10, -- x coordinate of the end position 
    endY = 10, -- y coordinate of the end position 
    endZ = 10 -- z coordinate of the end position 
} 
  
addEventHandler( "onClientHUDRender", root, 
    function( ) 
        dxDrawLine3D( position.startX, position.startY, position.startZ, position.endX, position.endY, position.endZ, tocolor( 245, 20, 20, 180 ), 3.25 ) 
    end 
) 

That marker is made with mathematical calculations to make it a circle. Simply just read more about trigonometric functions and test the formula examples, which you can find by searching on Google. The one you are especially looking for is the unit circle.

Edited by Guest
Posted

Thanks myonlake, no problem with the normal marker. no need to :O my mind and learn some new mathematical calculations and trigonometric functions. so i will use the normal marker :D

Posted

I wonder what do you mean by "new mathematical calculations"? I recall all schools in this world teach people trigonometric functions, but okay. And they also teach how to calculate spheres, so yep...

But, you're welcome.

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