How to use RotateAroundAxis properly?

I am using cam3D2D on a entity and I need to rotate the 3d2d. I am trying to use RotateAroundAxis but its giving me errors, what am I doing wrong.

	local pos = self:GetPos() + self:GetAngles():Up() * 60 + self:GetAngles():Forward() * 15
	local angle = self:GetAngles() * self:GetAngles():RotateAroundAxis(Vector(10,10,10),10)

	cam.Start3D2D(pos, angle, .1)
             // drawing stuff

rotatearoundaxis applies a transformation to an angle based on the given vector direction.

The main purpose is to apply transformations without worrying about gimbal lock

ang:RotateAroundAxis( vec:Up(), 45 )
ang:RotateAroundAxis( vec:Left(), 45 )
ang:RotateAroundAxis( vec:Forward(), 45 )

This is functionally identical to doing this;
local myAng=Angle(45,45,45)
local myRotatedAng=ent:LocalToWorldAngles( myAng )

local myAng=Angle()
local myEntAng=ent:GetAngles()


Personally i’ve never seen the appeal.

Thanks so much! Very helpful! But I am confused on something. What does “vec” stand for?

Here is my code and I am getting a error


^^ Drill is a Entity ^^

it’s meant to be ang, not vec. typo ;o

and to repeat myself;

meaning it doesn’t return anything so you can’t use it like that.

this is similar to the behaviour of this function:

Im still confused, how do I use it?

To repeat myself, Again,

except use ent:GetAngles() as “myAng”.
Then just do ent:SetAngles(myAng)

I tried doing this and it still didnt work?

local setAng = Angle()
local setEntAng = ent:GetAngles()

drill:SetAngles(setAng:RotateAroundAxis(setEntAng:Up(), 90))

Breaks out the spoon

local myAng = ent:GetAngles()
local entAng = ent:GetAngles()