Disclaimer: I fully realize Excel was not exactly designed to do what I'm trying to do with it, but that's what makes this fun!
I've built a program in Excel/VBA that takes 3D (x,y,z) plot points and programatically draws them on the screen after converting to 2D based on a rotation/shift matrix along with angles and viewer placement, etc. Fun stuff.
The problem is that it's slow! The method that I'm using basically loads 4 plot points into an array (the 4 corners of a square) and then draws the shape with this:
ActiveSheet.Shapes.AddPolyline(polylineArray)
Works great, but using this to draw the 6 faces of a cube takes about 150 milliseconds (timing that one line, specifically -- by far the most time consuming portion of all my subroutines in this program). And I need it to draw hundreds or thousands of cubes, which can take minutes.
Any tricks to speed this up? Already have screen updating off, and I've tried drawing more basic lines instead of polylines, no help there. Seems like Excel is just slow when working with drawing objects.
I've built a program in Excel/VBA that takes 3D (x,y,z) plot points and programatically draws them on the screen after converting to 2D based on a rotation/shift matrix along with angles and viewer placement, etc. Fun stuff.
The problem is that it's slow! The method that I'm using basically loads 4 plot points into an array (the 4 corners of a square) and then draws the shape with this:
ActiveSheet.Shapes.AddPolyline(polylineArray)
Works great, but using this to draw the 6 faces of a cube takes about 150 milliseconds (timing that one line, specifically -- by far the most time consuming portion of all my subroutines in this program). And I need it to draw hundreds or thousands of cubes, which can take minutes.
Any tricks to speed this up? Already have screen updating off, and I've tried drawing more basic lines instead of polylines, no help there. Seems like Excel is just slow when working with drawing objects.