• RotateAroundAxis htlp
    5 replies, posted
how can i do the same thing in SDK? RotateAroundAxis, what exactly doing? VectorRotate()? AngleVectors()?
I didn't quite understand your post so here's a link to what you are talking about. [b][url=http://wiki.garrysmod.com/?title=Angle.RotateAroundAxis]Angle.RotateAroundAxis [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
i want to know how to implement RotateAroundAxis in c++
in mathlib/vmatrix.h there are these functions: [cpp]void MatrixFromAngles( const QAngle& vAngles, VMatrix& dst ); void MatrixRotate( VMatrix& dst, const Vector& vAxisOfRot, float angleDegrees ); void MatrixToAngles( const VMatrix& src, QAngle& vAngles );[/cpp] Hope this helps.
[CODE] QAngle eyesang(0.0f,90.0f,0.0f); QAngle ang; Vector f,r,u, vec; AngleVectors(eyesang,&f,&r,&u); VMatrix m; MatrixFromAngles(eyesang,m); MatrixRotate(m,r, 270.0f); MatrixToAngles(m, ang); DUMP_XYZ(ang); [/CODE] output is -0.000003 90.000000 -90.000000 [CODE] function ftest( player, command, arguments ) local eyeangles = Angle(0, 90, 0 ) eyeangles:RotateAroundAxis(eyeangles:Right(), 270) Msg(tostring(eyeangles)) end concommand.Add("test",ftest ) [/CODE] output is 90.000 90.000 0.000
You would have more luck in the programming forum.
Sorry, you need to Log In to post a reply to this thread.