DxDrawWiredSphere: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Remove obsolete Requirements section)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool dxDrawWiredSphere( float x, float y, float z, float radius, color theColor, float fLineWidth, uint iterations )
bool dxDrawWiredSphere( float x, float y, float z, float radius, int theColor, float fLineWidth, uint iterations )
</syntaxhighlight>
</syntaxhighlight>


Line 30: Line 30:
end)
end)
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|n/a|1.5.7-9.20328|}}


==See Also==
==See Also==
{{Drawing_functions}}
{{Drawing_functions}}
[[dxDrawWiredSphere]]
[[dxDrawWiredSphere]]

Latest revision as of 17:17, 7 November 2024

This function drawn same sphere as /showcol. It provides 4 levels of iterations which mean density of sphere. Adjust radius to iterations to get optimum density of mesh. About 50 spheres with iterations = 4 can cause fps drop.

Syntax

bool dxDrawWiredSphere( float x, float y, float z, float radius, int theColor, float fLineWidth, uint iterations )

Required Arguments

  • x, y, z: A position in world of sphere.
  • radius: A radius of sphere.
  • theColor: A color of sphere from tocolor function.
  • fLineWidth: A width of line
  • iterations : Number 1, 2, 3 or 4. 1 mean low density, 4 mean high.

Returns

Returns a true if the operation was successful, false otherwise.

Example

local BONE_IDS = {1, 2, 3, 4, 5, 6, 7, 8, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 51, 52, 53, 54}

addEventHandler('onClientRender', root, function()
    for k, v in ipairs(BONE_IDS) do
        local x, y, z = getPedBonePosition(localPlayer, v)
        local color = tocolor(math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255))
        dxDrawWiredSphere(x, y, z, 0.1, color, 0.1, 4)
    end
end)

See Also


dxDrawWiredSphere