3D2D - Keep Size Despite Distance

If I’m drawing a circle in 3D2D - how can I make it keep the same ‘size’ no matter how far away you are.

It’s a marker to show where the player needs to go - but the further away you get, the ‘smaller’ it gets so it’s impossible to see / read.

local player_angles = LocalPlayer():GetAngles()

cam.Start3D2D( hint_data.position, Angle( 0, player_angles.y + 270, 90 ), 0.1 )

	surface.SetDrawColor( 255, 255, 255, 127.5 )
	surface.DrawArc( circle1 )


The tiny thing is the 3D2D - the Red Circle is how big it is roughly when you’re up close.

You could modify the scale value by the distance, however you might want to try a different method altogether. You could instead draw it in a 2D rendering instance such as DrawHUD, and position it by converting the 3D position to the 2D Screen position. You can then do fancy transitions such as fading out over distance, and having it lerp from position to position when you moving your camera, creating a smooth aspect.

Wow, that works 100 x better. Thanks a lot.

Also thanks to Neth - cause didn’t understand that he was trying to explain this too :wink:

[editline]5th February 2017[/editline]
What do you mean by
“and having it lerp from position to position when you moving your camera, creating a smooth aspect.”

Instead of directly setting the 2D position of what you are drawing to the 2D position given by

Vector:ToScreen, you can have it gradually move from it’s previous 2D position to the new “correct” 2D position. This will replace a sharp “snapping” of what you are drawing to a more smooth “gliding” effect. Depending on how you implement it, you can have it move faster or slower, and even have its speed have a gradient.

It’s all personal preference, if it’s a waypoint indicator or such, a smooth gliding might work better, however, if it is more of a target kind of thing, you would prefer to have it snap sharply to the position.