function isObstacle(vector, brush) if brush == nil then return IsWall(D3DXVECTOR3(vector.x, 0, vector.z)) or IsWallOfGrass(D3DXVECTOR3(vector.x, 0, vector.z)) elseif brush == false then return IsWall(D3DXVECTOR3(vector.x, 0, vector.z)) else return IsWallOfGrass(D3DXVECTOR3(vector.x, 0, vector.z)) end end function OnDraw() local x, y, z = player.x, player.y, player.z local radius = 1100 local quality = 2 * math.pi / 30 local points = {} for theta = 0, 2 * math.pi + quality, quality do local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta))) for step = 0, radius, 50 do if isObstacle(Vector(x + step * math.cos(theta), y, z - step * math.sin(theta)), false) then break else c = WorldToScreen(D3DXVECTOR3(x + step * math.cos(theta), y, z - step * math.sin(theta))) end end points[#points + 1] = D3DXVECTOR2(c.x, c.y) end DrawLines2(points, 1, 4294967295) end