Page 1 of 1

gl.DrawGroundCircle and gl.DrawGroundQuad - help needed

Posted: 04 Oct 2010, 19:54
by knorke
what i want:
draw on the terrain, in this case to mark units

what i tried:
http://springrts.com/wiki/Lua_OpenGL_Ap ... Primitives

Code: Select all

function widget:DrawScreen()
for i in pairs(builders) do
	local x,y,z=Spring.GetUnitPosition (i)
	gl.DrawGroundCircle (x,y,z, 100, 100,10) --a r=100 circle
	gl.DrawGroundQuad (x-50,z-50, x+50,z+50)	--a 100x100 square
	end
end
what i got:
screen00559.png
(3.94 MiB) Downloaded 3 times
If the unit moves to the right the circle/square move the right too etc, but thats all.
The circles and square are not on the units, dont look like circles or squares. Also they seem to draw on the screen like an GUI element and not on the terrain: when moving the camera, they stay in place.

what i am doing wrong:
your turn

Re: gl.DrawGroundCircle and gl.DrawGroundQuad - help needed

Posted: 04 Oct 2010, 20:19
by knorke
must use widget:DrawWorld instead of widget:DrawScreen

thanks quantaum