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
89c0a242
Commit
89c0a242
authored
May 27, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 3D view on OpenGL older than 1.5
parent
1bad79fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
gcview.py
printrun/gcview.py
+0
-1
actors.py
printrun/libtatlin/actors.py
+19
-5
No files found.
printrun/gcview.py
View file @
89c0a242
...
@@ -26,7 +26,6 @@ pyglet.options['debug_gl'] = True
...
@@ -26,7 +26,6 @@ pyglet.options['debug_gl'] = True
from
pyglet.gl
import
*
from
pyglet.gl
import
*
from
pyglet
import
gl
from
pyglet
import
gl
from
pyglet.graphics.vertexbuffer
import
create_buffer
from
printrun
import
gcoder
from
printrun
import
gcoder
from
printrun
import
stltool
from
printrun
import
stltool
...
...
printrun/libtatlin/actors.py
View file @
89c0a242
...
@@ -23,7 +23,7 @@ import sys
...
@@ -23,7 +23,7 @@ import sys
from
pyglet.gl
import
*
from
pyglet.gl
import
*
from
pyglet
import
gl
from
pyglet
import
gl
from
pyglet.graphics.vertexbuffer
import
create_buffer
from
pyglet.graphics.vertexbuffer
import
create_buffer
,
VertexBufferObject
from
.
import
vector
from
.
import
vector
...
@@ -339,7 +339,11 @@ class GcodeModel(Model):
...
@@ -339,7 +339,11 @@ class GcodeModel(Model):
def
_display_movements
(
self
,
mode_2d
=
False
):
def
_display_movements
(
self
,
mode_2d
=
False
):
self
.
vertex_buffer
.
bind
()
self
.
vertex_buffer
.
bind
()
has_vbo
=
isinstance
(
self
.
vertex_buffer
,
VertexBufferObject
)
if
has_vbo
:
glVertexPointer
(
3
,
GL_FLOAT
,
0
,
None
)
glVertexPointer
(
3
,
GL_FLOAT
,
0
,
None
)
else
:
glVertexPointer
(
3
,
GL_FLOAT
,
0
,
self
.
vertex_buffer
.
ptr
)
if
mode_2d
:
if
mode_2d
:
glScale
(
1.0
,
1.0
,
0.0
)
# discard z coordinates
glScale
(
1.0
,
1.0
,
0.0
)
# discard z coordinates
...
@@ -360,7 +364,10 @@ class GcodeModel(Model):
...
@@ -360,7 +364,10 @@ class GcodeModel(Model):
glEnableClientState
(
GL_COLOR_ARRAY
)
glEnableClientState
(
GL_COLOR_ARRAY
)
self
.
vertex_color_buffer
.
bind
()
self
.
vertex_color_buffer
.
bind
()
if
has_vbo
:
glColorPointer
(
4
,
GL_FLOAT
,
0
,
None
)
glColorPointer
(
4
,
GL_FLOAT
,
0
,
None
)
else
:
glColorPointer
(
4
,
GL_FLOAT
,
0
,
self
.
vertex_color_buffer
.
ptr
)
start
=
max
(
self
.
printed_until
,
0
)
start
=
max
(
self
.
printed_until
,
0
)
end
=
end
-
start
end
=
end
-
start
...
@@ -372,10 +379,17 @@ class GcodeModel(Model):
...
@@ -372,10 +379,17 @@ class GcodeModel(Model):
def
_display_arrows
(
self
):
def
_display_arrows
(
self
):
self
.
arrow_buffer
.
bind
()
self
.
arrow_buffer
.
bind
()
has_vbo
=
isinstance
(
self
.
arrow_buffer
,
VertexBufferObject
)
if
has_vbo
:
glVertexPointer
(
3
,
GL_FLOAT
,
0
,
None
)
glVertexPointer
(
3
,
GL_FLOAT
,
0
,
None
)
else
:
glVertexPointer
(
3
,
GL_FLOAT
,
0
,
self
.
arrow_buffer
.
ptr
)
self
.
arrow_color_buffer
.
bind
()
self
.
arrow_color_buffer
.
bind
()
if
has_vbo
:
glColorPointer
(
4
,
GL_FLOAT
,
0
,
None
)
glColorPointer
(
4
,
GL_FLOAT
,
0
,
None
)
else
:
glColorPointer
(
4
,
GL_FLOAT
,
0
,
self
.
arrow_color_buffer
.
ptr
)
start
=
(
self
.
layer_stops
[
self
.
num_layers_to_draw
-
1
]
//
2
)
*
3
start
=
(
self
.
layer_stops
[
self
.
num_layers_to_draw
-
1
]
//
2
)
*
3
end
=
(
self
.
layer_stops
[
self
.
num_layers_to_draw
]
//
2
)
*
3
end
=
(
self
.
layer_stops
[
self
.
num_layers_to_draw
]
//
2
)
*
3
...
...
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