From 8f2f21d8738cd2832bccf28d7e5da30c9af36004 Mon Sep 17 00:00:00 2001 From: Justin Mopp Date: Tue, 25 Oct 2016 20:50:09 +0200 Subject: [PATCH 1/3] Ensure glVertex3fv call doesn't TypeError --- pyparticles/ogl/axis_ogl.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyparticles/ogl/axis_ogl.py b/pyparticles/ogl/axis_ogl.py index f2c074b..ad35f1e 100644 --- a/pyparticles/ogl/axis_ogl.py +++ b/pyparticles/ogl/axis_ogl.py @@ -122,8 +122,8 @@ def draw_plane( self , plane="xy", color=( 0.7 , 0.7 , 0.7 , 0.3 ) , leng=None ) glBegin(GL_LINES) for pts in t : - glVertex3fv( pts[0] ) - glVertex3fv( pts[1] ) + glVertex3fv( pts[0].tolist() ) + glVertex3fv( pts[1].tolist() ) glEnd() @@ -199,12 +199,12 @@ def draw_arrow( self , color , axis , leng=None ): glBegin(GL_LINES) for pts in t : - glVertex3fv( pts[0] ) - glVertex3fv( pts[1] ) + glVertex3fv( pts[0].tolist() ) + glVertex3fv( pts[1].tolist() ) glEnd() - \ No newline at end of file + From cb31befd3eb68c5babce5f552498be0c3f0f45b5 Mon Sep 17 00:00:00 2001 From: Justin Mopp Date: Wed, 26 Oct 2016 14:49:07 +0200 Subject: [PATCH 2/3] Keep numpy arrays in numpy land --- pyparticles/ogl/axis_ogl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyparticles/ogl/axis_ogl.py b/pyparticles/ogl/axis_ogl.py index ad35f1e..73f2fc7 100644 --- a/pyparticles/ogl/axis_ogl.py +++ b/pyparticles/ogl/axis_ogl.py @@ -122,8 +122,8 @@ def draw_plane( self , plane="xy", color=( 0.7 , 0.7 , 0.7 , 0.3 ) , leng=None ) glBegin(GL_LINES) for pts in t : - glVertex3fv( pts[0].tolist() ) - glVertex3fv( pts[1].tolist() ) + glVertex3fv( pts[0].view(type=np.ndarray) ) + glVertex3fv( pts[1].view(type=np.ndarray) ) glEnd() @@ -199,8 +199,8 @@ def draw_arrow( self , color , axis , leng=None ): glBegin(GL_LINES) for pts in t : - glVertex3fv( pts[0].tolist() ) - glVertex3fv( pts[1].tolist() ) + glVertex3fv( pts[0].view(type=np.ndarray) ) + glVertex3fv( pts[1].view(type=np.ndarray) ) glEnd() From 8a55b314b4f9e789fa24ee1a386a8e146fd05f50 Mon Sep 17 00:00:00 2001 From: Justin Mopp Date: Sat, 29 Oct 2016 14:40:52 +0200 Subject: [PATCH 3/3] Fix glVertex3fv call in drawing of vector fields --- pyparticles/ogl/draw_vector_field.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyparticles/ogl/draw_vector_field.py b/pyparticles/ogl/draw_vector_field.py index 6cb0908..9097aa3 100644 --- a/pyparticles/ogl/draw_vector_field.py +++ b/pyparticles/ogl/draw_vector_field.py @@ -195,14 +195,14 @@ def _draw_field( self , key ): glColor4f( color[0] , color[1] , color[2] , color[3] ) - glVertex3fv( pts[0] ) - glVertex3fv( pts[1] ) + glVertex3fv( pts[0].view(type=np.ndarray) ) + glVertex3fv( pts[1].view(type=np.ndarray) ) - glVertex3fv( pts[2] ) - glVertex3fv( pts[3] ) + glVertex3fv( pts[2].view(type=np.ndarray) ) + glVertex3fv( pts[3].view(type=np.ndarray) ) - glVertex3fv( pts[4] ) - glVertex3fv( pts[5] ) + glVertex3fv( pts[4].view(type=np.ndarray) ) + glVertex3fv( pts[5].view(type=np.ndarray) ) glEnd()