Page 1 of 1

making gl.UnitShape() work in drawscreen with loadidentity

Posted: 08 Feb 2018, 01:04
by Floris
The widget I want to fix is Idle Builders. But I just don't understand how I can show up the unitshapes when using gl.loadidentity() what the wiki suggests.

The widget code: https://github.com/Balanced-Annihilatio ... s.lua#L292

For now I disabled glLoadIdentity() cause I cant get the models to show when I enable it.

Example whats currently broken about at certain camera positions, fading away to the background color.
Image

the relevant code:

Code: Select all

glPushMatrix()
--glLoadIdentity()
glScissor(X1, Y_MIN, X2 - X1, Y_MAX - Y_MIN)

glTranslate(0.5*(X2+X1), 0.5*(Y_MAX+Y_MIN), 0)
glRotate(18, 1, 0, 0)
glRotate(rot, 0, 1, 0)

CenterUnitDef(drawTable[ct].unitDefID)

glUnitShape(drawTable[ct].unitDefID, GetMyTeamID(), false, true, true)

glScissor(false)
glPopMatrix()