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
f3fff426
Commit
f3fff426
authored
Jun 15, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More work towards a cleaner 3D view
parent
f5255cde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
gcview.py
printrun/gcview.py
+9
-12
No files found.
printrun/gcview.py
View file @
f3fff426
...
@@ -119,7 +119,7 @@ class wxGLPanel(wx.Panel):
...
@@ -119,7 +119,7 @@ class wxGLPanel(wx.Panel):
glViewport
(
0
,
0
,
width
,
height
)
glViewport
(
0
,
0
,
width
,
height
)
glMatrixMode
(
GL_PROJECTION
)
glMatrixMode
(
GL_PROJECTION
)
glLoadIdentity
()
glLoadIdentity
()
gluPerspective
(
60.
,
width
/
float
(
height
),
10.0
,
self
.
dist
)
gluPerspective
(
60.
,
width
/
float
(
height
),
10.0
,
3
*
self
.
dist
)
glMatrixMode
(
GL_MODELVIEW
)
glMatrixMode
(
GL_MODELVIEW
)
glLoadIdentity
()
glLoadIdentity
()
...
@@ -263,7 +263,9 @@ class GcodeViewPanel(wxGLPanel):
...
@@ -263,7 +263,9 @@ class GcodeViewPanel(wxGLPanel):
self
.
create_objects
()
self
.
create_objects
()
glPushMatrix
()
glPushMatrix
()
glTranslatef
(
-
self
.
parent
.
platform
.
width
/
2
,
-
self
.
parent
.
platform
.
depth
/
2
,
-
self
.
dist
)
glTranslatef
(
0
,
0
,
-
self
.
dist
)
# Move back
glMultMatrixd
(
build_rotmatrix
(
self
.
basequat
))
# Rotate according to trackball
glTranslatef
(
-
self
.
parent
.
platform
.
width
/
2
,
-
self
.
parent
.
platform
.
depth
/
2
,
0
)
# Move origin to bottom left of platform
for
obj
in
self
.
parent
.
objects
:
for
obj
in
self
.
parent
.
objects
:
if
not
obj
.
model
or
not
obj
.
model
.
loaded
or
not
obj
.
model
.
initialized
:
if
not
obj
.
model
or
not
obj
.
model
.
loaded
or
not
obj
.
model
.
initialized
:
...
@@ -299,17 +301,12 @@ class GcodeViewPanel(wxGLPanel):
...
@@ -299,17 +301,12 @@ class GcodeViewPanel(wxGLPanel):
self
.
initpos
=
None
self
.
initpos
=
None
p2
=
event
.
GetPositionTuple
()
p2
=
event
.
GetPositionTuple
()
sz
=
self
.
GetClientSize
()
sz
=
self
.
GetClientSize
()
p1x
=
(
float
(
p1
[
0
])
-
sz
[
0
]
/
2
)
/
(
sz
[
0
]
/
2
)
p1x
=
float
(
p1
[
0
])
/
(
sz
[
0
]
/
2
)
-
1
p1y
=
-
(
float
(
p1
[
1
])
-
sz
[
1
]
/
2
)
/
(
sz
[
1
]
/
2
)
p1y
=
1
-
float
(
p1
[
1
])
/
(
sz
[
1
]
/
2
)
p2x
=
(
float
(
p2
[
0
])
-
sz
[
0
]
/
2
)
/
(
sz
[
0
]
/
2
)
p2x
=
float
(
p2
[
0
])
/
(
sz
[
0
]
/
2
)
-
1
p2y
=
-
(
float
(
p2
[
1
])
-
sz
[
1
]
/
2
)
/
(
sz
[
1
]
/
2
)
p2y
=
1
-
float
(
p2
[
1
])
/
(
sz
[
1
]
/
2
)
#print p1x, p1y, p2x, p2y
quat
=
trackball
(
p1x
,
p1y
,
p2x
,
p2y
,
self
.
dist
/
250.0
)
quat
=
trackball
(
p1x
,
p1y
,
p2x
,
p2y
,
-
self
.
transv
[
2
]
/
250.0
)
self
.
basequat
=
mulquat
(
self
.
basequat
,
quat
)
self
.
basequat
=
mulquat
(
self
.
basequat
,
quat
)
mat
=
build_rotmatrix
(
self
.
basequat
)
glLoadIdentity
()
glTranslatef
(
*
self
.
transv
)
glMultMatrixd
(
mat
)
elif
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
elif
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
if
self
.
initpos
is
not
None
:
if
self
.
initpos
is
not
None
:
...
...
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