[HOpenGL] GLU NURBS rendered wrongly

Alexey Karakulov ankarakulov at gmail.com
Tue Oct 18 13:20:16 CEST 2011


I suppose I found the reason. It's in the ControlPoint class. Attached the
patch for Graphics/Rendering/OpenGL/GL/ControlPoint.hs

On Tue, Oct 18, 2011 at 1:02 PM, Alexey Karakulov <ankarakulov at gmail.com>wrote:

> Description:
> GLU NURBS are rendered wrongly with newer versions of OpenGL.
> E.g. when the 9-point rectangular representation for a circle is used, this
> picture is a result (instead of a proper circle):
> http://i.stack.imgur.com/waoRm.png
> There are other details at the
> http://stackoverflow.com/questions/7798662/glu-nurbs-rendered-wrongly
>
> Versions:
> The bug appears when OpenGL>=2.3 is used. With older versions the NURBS for
> circle is rendered correctly:
> $ ghc -package OpenGL-2.2.3.0 -package GLUT-2.1.2.1 --make Circle.hs &&
> ./Circle
>
> Platforms tested:
> ArchLinux 64-bit, Gentoo (don't know architecture).
>
>
> The Circle.hs file which draws the NURBS circle is attached.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/hopengl/attachments/20111018/38eb948f/attachment.htm>
-------------- next part --------------
diff -c /home/alex/src/OpenGL-2.4.0.1/Graphics/Rendering/OpenGL/GL/ControlPoint.hs /tmp/buffer-content-11380Kl2
*** /home/alex/src/OpenGL-2.4.0.1/Graphics/Rendering/OpenGL/GL/ControlPoint.hs	2009-09-13 17:54:49.000000000 +0300
--- /tmp/buffer-content-11380Kl2	2011-10-18 14:12:55.873827941 +0300
***************
*** 156,162 ****
     Map1TextureCoord3 -> gl_MAP1_TEXTURE_COORD_3
     Map1TextureCoord4 -> gl_MAP1_TEXTURE_COORD_4
     Map1Vertex3 -> gl_MAP1_VERTEX_3
!    Map1Vertex4 -> gl_MAP1_VERTEX_3
     Map2Color4 -> gl_MAP2_COLOR_4
     Map2Index -> gl_MAP2_INDEX
     Map2Normal -> gl_MAP2_NORMAL
--- 156,162 ----
     Map1TextureCoord3 -> gl_MAP1_TEXTURE_COORD_3
     Map1TextureCoord4 -> gl_MAP1_TEXTURE_COORD_4
     Map1Vertex3 -> gl_MAP1_VERTEX_3
!    Map1Vertex4 -> gl_MAP1_VERTEX_4
     Map2Color4 -> gl_MAP2_COLOR_4
     Map2Index -> gl_MAP2_INDEX
     Map2Normal -> gl_MAP2_NORMAL

Diff finished.  Tue Oct 18 14:12:56 2011


More information about the HOpenGL mailing list