Re: GLU NURBS precision
Chris Barker <[email protected]> Fri, 26 Oct 2012 17:28:55 -0800
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <4265661263147110194@unknownmsgid> |
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" <[email protected]> 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/pyopengl-users ------------------------------------------------------------------------------ WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ _______________________________________________ PyOpenGL Homepage http://pyopengl.sourceforge.net