Rotate sprite

How to rotate a sprite correctly?

[lua]
local pos = self.Owner:GetShootPos()
local ang = self.Owner:GetAimVector()
pos = pos+(ang*128)

local m = Matrix()
m:SetAngles(Angle(0, 90, 0))
m:SetTranslation(Vector(0, 0, 0))
cam.PushModelMatrix(m)
render.SetMaterial(Material( “sprites/blueglow2” ))
render.DrawSprite(pos, 20, 20, Color(255,255,255))
cam.PopModelMatrix()
[/lua]

This moves it somewhere random.

You don’t really rotate a sprite. If you really must do it, either edit the texture, or try looking into .vmt parameters.