• render.DrawBox not working
    2 replies, posted
Having problems with render drawbox ive given it a min and a max vector but it dosent draw ive hooked it in PostDrawOpaqueRenderables but no luck heres my code any ideas? [CODE]function Draw() for k, v in pairs(WayPoints) do ang = Angle(0, LocalPlayer():GetAngles().y - 90, 90) cam.Start3D2D(v + Vector(0, 0, iHeight + 50), ang, 0.18); draw.SimpleTextOutlined("Waypoint: " .. k, "CV30", 0, 20, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0, 0, 0, 255)); cam.End3D2D(); render.SetMaterial(BallMat) render.DrawSphere(v + Vector(0, 0, iHeight), 5, 15, 10, Color(0, 255, 120, 0)); if(WayPoints[k + 1] != nil) then local vPosA = v + Vector(0, 0, iHeight + 2); local vPosB = WayPoints[k + 1] + Vector(0, 0, iHeight + 2); render.SetMaterial(Laser) render.DrawBeam(vPosA, vPosB, 5, 1, 1, Color(0, 255, 175, 255)) render.DrawBox(vPosA, Angle(0, 0, 90), vPosA, vPosB, Color(0, 255, 0, 255)) end end end hook.Remove("PostDrawOpaqueRenderables", "DraWaypoints"); hook.Add("PostDrawOpaqueRenderables", "DrawWaypoints", Draw); [/CODE] DrawSphere and DrawBeam work fine confused as to why draw box dosent.
Min and Max vectors are not a world position but a local position. You want to give it something like Vector( -32, -32, -32) for mins and Vector( 32, 32, 32 ) for maxs. That will draw 64x64x64 box in the given position vPosA.
And if that doesn't help, try posting it in another section, might get better help there.
Sorry, you need to Log In to post a reply to this thread.