Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
f5a95e54
Commit
f5a95e54
authored
Jul 30, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add lights to gcview
parent
5b454175
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
gcview.py
printrun/gcview.py
+14
-0
actors.py
printrun/gl/libtatlin/actors.py
+3
-0
No files found.
printrun/gcview.py
View file @
f5a95e54
...
...
@@ -22,9 +22,11 @@ from . import gcoder
from
.gl.panel
import
wxGLPanel
from
.gl.trackball
import
build_rotmatrix
from
.gl.libtatlin
import
actors
from
.gl.libtatlin.actors
import
vec
from
pyglet.gl
import
glPushMatrix
,
glPopMatrix
,
\
glTranslatef
,
glRotatef
,
glScalef
,
glMultMatrixd
from
pyglet.gl
import
*
from
.gviz
import
GvizBaseFrame
...
...
@@ -71,6 +73,10 @@ class GcodeViewPanel(wxGLPanel):
self
.
parent
.
loadcb
()
self
.
parent
.
filenames
=
None
glEnable
(
GL_LIGHTING
)
glEnable
(
GL_LIGHT0
)
glEnable
(
GL_LIGHT1
)
def
create_objects
(
self
):
'''create opengl objects when opengl is initialized'''
for
obj
in
self
.
parent
.
objects
:
...
...
@@ -97,6 +103,14 @@ class GcodeViewPanel(wxGLPanel):
platformy0
=
-
self
.
build_dimensions
[
4
]
-
self
.
parent
.
platform
.
depth
/
2
glTranslatef
(
platformx0
,
platformy0
,
0
)
light_z
=
max
(
self
.
parent
.
platform
.
width
,
self
.
parent
.
platform
.
depth
)
glLightfv
(
GL_LIGHT0
,
GL_POSITION
,
vec
(
0
,
self
.
parent
.
platform
.
depth
/
2
,
light_z
,
0
))
glLightfv
(
GL_LIGHT0
,
GL_POSITION
,
vec
(
self
.
parent
.
platform
.
width
,
self
.
parent
.
platform
.
depth
/
2
,
light_z
,
0
))
for
obj
in
self
.
parent
.
objects
:
if
not
obj
.
model
\
or
not
obj
.
model
.
loaded
\
...
...
printrun/gl/libtatlin/actors.py
View file @
f5a95e54
...
...
@@ -36,6 +36,9 @@ from pyglet.graphics.vertexbuffer import create_buffer, VertexBufferObject
from
printrun.printrun_utils
import
install_locale
install_locale
(
'pronterface'
)
def
vec
(
*
args
):
return
(
GLfloat
*
len
(
args
))(
*
args
)
def
compile_display_list
(
func
,
*
options
):
display_list
=
glGenLists
(
1
)
glNewList
(
display_list
,
GL_COMPILE
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment