Update on the 3D preview, remove the boxed lines and make an "inside viewing" box.
This commit is contained in:
parent
58f4edbef9
commit
b63fe56621
1 changed files with 67 additions and 32 deletions
|
|
@ -59,6 +59,38 @@ def DrawMachine(machineSize):
|
|||
glVertex3f(0, i, 0)
|
||||
glVertex3f(machineSize.x, i, 0)
|
||||
glEnd()
|
||||
|
||||
glEnable(GL_LINE_SMOOTH)
|
||||
glEnable(GL_BLEND)
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||
glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
|
||||
|
||||
glColor3f(0.0,0.0,0.0)
|
||||
glLineWidth(4)
|
||||
glBegin(GL_LINE_LOOP)
|
||||
glVertex3f(0, 0, 0)
|
||||
glVertex3f(machineSize.x, 0, 0)
|
||||
glVertex3f(machineSize.x, machineSize.y, 0)
|
||||
glVertex3f(0, machineSize.y, 0)
|
||||
glEnd()
|
||||
|
||||
glLineWidth(2)
|
||||
glBegin(GL_LINE_LOOP)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, machineSize.y, machineSize.z)
|
||||
glVertex3f(0, machineSize.y, machineSize.z)
|
||||
glEnd()
|
||||
glBegin(GL_LINES)
|
||||
glVertex3f(0, 0, 0)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, 0, 0)
|
||||
glVertex3f(machineSize.x, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, machineSize.y, 0)
|
||||
glVertex3f(machineSize.x, machineSize.y, machineSize.z)
|
||||
glVertex3f(0, machineSize.y, 0)
|
||||
glVertex3f(0, machineSize.y, machineSize.z)
|
||||
glEnd()
|
||||
else:
|
||||
glDisable(GL_CULL_FACE)
|
||||
glEnable(GL_BLEND)
|
||||
|
|
@ -94,40 +126,43 @@ def DrawMachine(machineSize):
|
|||
glVertex3f(x, min(y+10, machineSize.y), -0.01)
|
||||
glEnd()
|
||||
glEnable(GL_CULL_FACE)
|
||||
|
||||
glColor4ub(5,171,231,128)
|
||||
glBegin(GL_QUADS)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
glVertex3f(0, machineSize.y, machineSize.z)
|
||||
glVertex3f(machineSize.x, machineSize.y, machineSize.z)
|
||||
glVertex3f(machineSize.x, 0, machineSize.z)
|
||||
glEnd()
|
||||
|
||||
glColor4ub(5,171,231,192)
|
||||
glBegin(GL_QUADS)
|
||||
glVertex3f(0, 0, 0)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, 0, 0)
|
||||
|
||||
glVertex3f(0, machineSize.y, machineSize.z)
|
||||
glVertex3f(0, machineSize.y, 0)
|
||||
glVertex3f(machineSize.x, machineSize.y, 0)
|
||||
glVertex3f(machineSize.x, machineSize.y, machineSize.z)
|
||||
glEnd()
|
||||
|
||||
glColor4ub(5,171,231,255)
|
||||
glBegin(GL_QUADS)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
glVertex3f(0, 0, 0)
|
||||
glVertex3f(0, machineSize.y, 0)
|
||||
glVertex3f(0, machineSize.y, machineSize.z)
|
||||
|
||||
glVertex3f(machineSize.y, 0, 0)
|
||||
glVertex3f(machineSize.y, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, machineSize.y, machineSize.z)
|
||||
glVertex3f(machineSize.x, machineSize.y, 0)
|
||||
glEnd()
|
||||
|
||||
glDisable(GL_BLEND)
|
||||
|
||||
glEnable(GL_LINE_SMOOTH)
|
||||
glEnable(GL_BLEND)
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||
glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
|
||||
|
||||
glColor3f(0.0,0.0,0.0)
|
||||
glLineWidth(4)
|
||||
glBegin(GL_LINE_LOOP)
|
||||
glVertex3f(0, 0, 0)
|
||||
glVertex3f(machineSize.x, 0, 0)
|
||||
glVertex3f(machineSize.x, machineSize.y, 0)
|
||||
glVertex3f(0, machineSize.y, 0)
|
||||
glEnd()
|
||||
|
||||
glLineWidth(2)
|
||||
glBegin(GL_LINE_LOOP)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, machineSize.y, machineSize.z)
|
||||
glVertex3f(0, machineSize.y, machineSize.z)
|
||||
glEnd()
|
||||
glBegin(GL_LINES)
|
||||
glVertex3f(0, 0, 0)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, 0, 0)
|
||||
glVertex3f(machineSize.x, 0, machineSize.z)
|
||||
glVertex3f(machineSize.x, machineSize.y, 0)
|
||||
glVertex3f(machineSize.x, machineSize.y, machineSize.z)
|
||||
glVertex3f(0, machineSize.y, 0)
|
||||
glVertex3f(0, machineSize.y, machineSize.z)
|
||||
glEnd()
|
||||
|
||||
glPushMatrix()
|
||||
glTranslate(-5,-5,0)
|
||||
glLineWidth(2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue