Given OpenGL uses single precision- I'd use single (numpy.float32) for
your numpy arrays, too. One of the nice things about numpy.
-chb
On Oct 26, 2012, at 10:38 AM, "Mike C. Fletcher" <mcf...@vr...> wrote:
> On 12-10-26 10:21 AM, Hugo Gagnon wrote:
>> Hello,
>>
>> I'm writing an application that uses GLU's NURBS capabilities. I'm
>> passing double-precision numpy arrays to gluNurbsCurve and
>> gluNurbsSurface, which works fine, only that PyOpenGL seems to
>> automatically convert them to single-precision, which slows down my app.
>> Does this conversion have to do with PyOpenGL or is it an OpenGL
>> limitation? Is there any way around it? other than having to keep
>> track of two arrays of different types around...
> The C-level function requires GLfloat * arrays (i.e. single precision).
> PyOpenGL, by default, will copy the array if the type is not compatible
> with the target function. So the conversion is PyOpenGL, but if it
> didn't do it you'd get a garbage result (each half of your double
> interpreted as a float).
>
> HTH,
> Mike
>
> --
> ________________________________________________
> Mike C. Fletcher
> Designer, VR Plumber, Coder
> http://www.vrplumber.com
> http://blog.vrplumber.com
>
>
> ------------------------------------------------------------------------------
> The Windows 8 Center
> In partnership with Sourceforge
> Your idea - your app - 30 days. Get started!
> http://windows8center.sourceforge.net/
> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
> _______________________________________________
> PyOpenGL Homepage
> http://pyopengl.sourceforge.net
> _______________________________________________
> PyOpenGL-Users mailing list
> PyO...@li...
> https://lists.sourceforge.net/lists/listinfo/pyopengl-users
|