Very simple example:
Code: Select all
local function TestDraw()
gl.Color({1,1,1,0})
for sniper in pairs(sniperList) do
local x, y, z = Spring.GetUnitPosition(sniper)
gl.Vertex(x,y,z+1000)
gl.Vertex(x,y,z-1000)
gl.Vertex(x,y+1000,z)
gl.Vertex(x,y-1000,z)
gl.Vertex(x+1000,y,z)
gl.Vertex(x-1000,y,z)
end
end
function widget:DrawWorldPreUnit()
gl.DepthTest(true)
gl.BeginEnd(GL.LINE, TestDraw)
end
The OpenGL coordinates and the unit positions are the same I suppose!?