Vec2Array has an array of doubles underlying it, which is good for
precision, but not so good for using directly with OpenGL. My
intention is to add an api to let you use a Vec2Array (actually any
Seq2 subclass, which Vec2Array is one) to populate an array of floats
using the Python buffer api. This should allow you to directly
populate a ctypes float array, a stdlib float array, or a numpy float
array. There's a bit more overhead there converting doubles to floats,
but it lets the canonical data have a much higher precision, which imo
is worth the tradeoff.
If that's something you could use now, I can try and add it in in the
next few days.
-Casey
Yes numpy is probably a reasonable place to start. I typically find
storing canonical data in an opengl-friendly format less than ideal,
so I typically pay the price of a copy each time I want to update the
vertex array data. If it changes a lot (like nearly every vertex,
nearly every frame), the vertex array is basically disposable anyway.
Though it's perfectly possible to have some parts of the array static
(like colors and texture coordinates) while others are dynamic. Then
you can just update/re-create the dynamic parts each time.
Planar is really designed to be the "model" in an MVC architecture.
The vertex array data would be part of the view, and may or may not
persist between frames, that would be up to the view to decide.
-Casey
Right. That makes sense, I was thinking that my application was a bit of
an abuse of Planar, but was clutching all kinds of straws looking for
inspiration. Thanks for the guidance.
Jonathan
--
Jonathan Hartley Made of meat. http://tartley.com
tar...@tartley.com +44 7737 062 225 twitter/skype: tartley