• Cam3D2D 90 degrees up.
    4 replies, posted
I just want the rectangle to be 90 degrees even though I turn it. like I can't do Ang + Angle(90,0,0) cause when I start turning it f*cks up. [LUA] function ENT:Draw() self:DrawModel() -- Draw the model. local Pos = self:GetPos() local Ang = self:GetAngles() cam.Start3D2D(Pos, Ang, 1) surface.SetDrawColor(0,255,0,255) surface.DrawRect(0,0,10,10) cam.End3D2D() end [/LUA] Please help.
Ang.p = Ang.p + 90
90 degrees in relation to what? If you want the angle to be static don't use the entity's angles at all, i.e. [code] cam.Start3D2D(Pos, Angle(90, 0, 0), ... [/code]
[CODE]function ENT:Draw() self:DrawModel() -- Draw the model. local Pos = self:GetPos() local Ang = self:GetAngles() Ang:RotateAroundAxis(ang:Right(), 90) --Provide the axis and the rotation amount, ang:right() returns the direction vector for the X axis of the angle so its always relative to the entity instead of the world cam.Start3D2D(Pos, Ang, 1) surface.SetDrawColor(0,255,0,255) surface.DrawRect(0,0,10,10) cam.End3D2D() end[/CODE]
[QUOTE=0V3RR1D3;51806558][CODE]function ENT:Draw() self:DrawModel() -- Draw the model. local Pos = self:GetPos() local Ang = self:GetAngles() Ang:RotateAroundAxis(ang:Right(), 90) --Provide the axis and the rotation amount, ang:right() returns the direction vector for the X axis of the angle so its always relative to the entity instead of the world cam.Start3D2D(Pos, Ang, 1) surface.SetDrawColor(0,255,0,255) surface.DrawRect(0,0,10,10) cam.End3D2D() end[/CODE][/QUOTE] HUGE FAN! :pudge: And thanks it worked.
Sorry, you need to Log In to post a reply to this thread.