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
09fe67b5
Commit
09fe67b5
authored
Jun 15, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to orthographic projection
parent
b88342ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
gcview.py
printrun/gcview.py
+12
-1
No files found.
printrun/gcview.py
View file @
09fe67b5
...
...
@@ -34,6 +34,8 @@ from .libtatlin import actors
class
wxGLPanel
(
wx
.
Panel
):
'''A simple class for using OpenGL with wxPython.'''
orthographic
=
True
def
__init__
(
self
,
parent
,
id
,
pos
=
wx
.
DefaultPosition
,
size
=
wx
.
DefaultSize
,
style
=
0
):
# Forcing a no full repaint to stop flickering
...
...
@@ -119,9 +121,15 @@ class wxGLPanel(wx.Panel):
glViewport
(
0
,
0
,
width
,
height
)
glMatrixMode
(
GL_PROJECTION
)
glLoadIdentity
()
gluPerspective
(
60.
,
width
/
float
(
height
),
10.0
,
3
*
self
.
dist
)
if
self
.
orthographic
:
glOrtho
(
-
width
/
2
,
width
/
2
,
-
height
/
2
,
height
/
2
,
0.1
,
3
*
self
.
dist
)
else
:
gluPerspective
(
60.
,
float
(
width
)
/
height
,
10.0
,
3
*
self
.
dist
)
glMatrixMode
(
GL_MODELVIEW
)
glLoadIdentity
()
if
self
.
orthographic
:
ratio
=
0.9
*
float
(
min
(
self
.
width
,
self
.
height
))
/
self
.
dist
glScalef
(
ratio
,
ratio
,
1
)
# Wrap text to the width of the window
if
self
.
GLinitialized
:
...
...
@@ -386,6 +394,9 @@ class GcodeViewPanel(wxGLPanel):
def
mouse_to_3d
(
self
,
x
,
y
):
x
=
float
(
x
)
y
=
self
.
height
-
float
(
y
)
# The following could work if we were not initially scaling to zoom on the bed
#if self.orthographic:
# return (x - self.width / 2, y - self.height / 2, 0)
pmat
=
(
GLdouble
*
16
)()
mvmat
=
(
GLdouble
*
16
)()
viewport
=
(
GLint
*
4
)()
...
...
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