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
cfe998a6
Commit
cfe998a6
authored
Jul 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve drawing of cursor in stlview
parent
81127b31
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
panel.py
printrun/gl/panel.py
+2
-2
stlview.py
printrun/stlview.py
+2
-2
No files found.
printrun/gl/panel.py
View file @
cfe998a6
...
...
@@ -161,7 +161,7 @@ class wxGLPanel(wx.Panel):
#==========================================================================
# Utils
#==========================================================================
def
mouse_to_3d
(
self
,
x
,
y
):
def
mouse_to_3d
(
self
,
x
,
y
,
z
=
1.0
):
x
=
float
(
x
)
y
=
self
.
height
-
float
(
y
)
# The following could work if we were not initially scaling to zoom on the bed
...
...
@@ -176,7 +176,7 @@ class wxGLPanel(wx.Panel):
glGetIntegerv
(
GL_VIEWPORT
,
viewport
);
glGetDoublev
(
GL_PROJECTION_MATRIX
,
pmat
)
glGetDoublev
(
GL_MODELVIEW_MATRIX
,
mvmat
)
gluUnProject
(
x
,
y
,
1.0
,
mvmat
,
pmat
,
viewport
,
px
,
py
,
pz
)
gluUnProject
(
x
,
y
,
z
,
mvmat
,
pmat
,
viewport
,
px
,
py
,
pz
)
return
(
px
.
value
,
py
.
value
,
pz
.
value
)
def
zoom
(
self
,
factor
,
to
=
None
):
...
...
printrun/stlview.py
View file @
cfe998a6
...
...
@@ -342,8 +342,8 @@ class StlViewPanel(wxGLPanel):
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
)
# Draw mouse
glPushMatrix
()
x
,
y
,
_
=
self
.
mouse_to_3d
(
*
self
.
mousepos
)
glTranslatef
(
x
,
y
,
5
)
x
,
y
,
z
=
self
.
mouse_to_3d
(
self
.
mousepos
[
0
],
self
.
mousepos
[
1
],
0.9
)
glTranslatef
(
x
,
y
,
z
)
glBegin
(
GL_TRIANGLES
)
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT_AND_DIFFUSE
,
vec
(
1
,
0
,
0
,
1
))
glNormal3f
(
0
,
0
,
1
)
...
...
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