Re: GLU NURBS rendered wrongly

Alexey Karakulov <[email protected]> Tue, 18 Oct 2011 14:20:16 +0300
Newsgroups gmane.comp.lang.haskell.hopengl
Message-ID <CAAFtHKhvqz7WYcbRbDA8=NtmP1DQ16yR+FKbMzHSXaPfbD37ug@mail.gmail.com>
--0016368325ae861c7c04af90e873
Content-Type: multipart/alternative; boundary=0016368325ae861c7404af90e871

--0016368325ae861c7404af90e871
Content-Type: text/plain; charset=ISO-8859-1

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 <[email protected]>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.
>
>

--0016368325ae861c7404af90e871
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I suppose I found the reason. It&#39;s in the ControlPoint class. Attached =
the patch for Graphics/Rendering/OpenGL/GL/ControlPoint.hs<br><br><div clas=
s=3D"gmail_quote">On Tue, Oct 18, 2011 at 1:02 PM, Alexey Karakulov <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">[email protected]=
om</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">Description:<br><div class=3D"gmail_quote">=
<div class=3D"im">GLU NURBS are  rendered wrongly with newer versions of Op=
enGL.<br>
E.g. when the 9-point rectangular representation for a circle is used, this=
 picture is a result (instead of a proper circle): <a href=3D"http://i.stac=
k.imgur.com/waoRm.png" target=3D"_blank">http://i.stack.imgur.com/waoRm.png=
</a><br>


There are other details at the <a href=3D"http://stackoverflow.com/question=
s/7798662/glu-nurbs-rendered-wrongly" target=3D"_blank">http://stackoverflo=
w.com/questions/7798662/glu-nurbs-rendered-wrongly</a><br><br>Versions:<br>

The bug appears when OpenGL&gt;=3D2.3 is used. With older versions the NURB=
S for circle is rendered correctly:<br></div>$ ghc -package OpenGL-2.2.3.0 =
-package GLUT-2.1.2.1 --make Circle.hs &amp;&amp; ./Circle<br><br>Platforms=
 tested:<br>

ArchLinux 64-bit, Gentoo (don&#39;t know architecture).<div class=3D"im"><b=
r><br>The Circle.hs file which draws the NURBS circle is attached.<br>
</div></div><br>
</blockquote></div><br>

--0016368325ae861c7404af90e871--
--0016368325ae861c7c04af90e873
Content-Type: text/plain; charset=US-ASCII; name="ControlPoint.hs.diff"
Content-Disposition: attachment; filename="ControlPoint.hs.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gtwswnow1

ZGlmZiAtYyAvaG9tZS9hbGV4L3NyYy9PcGVuR0wtMi40LjAuMS9HcmFwaGljcy9SZW5kZXJpbmcv
T3BlbkdML0dML0NvbnRyb2xQb2ludC5ocyAvdG1wL2J1ZmZlci1jb250ZW50LTExMzgwS2wyCioq
KiAvaG9tZS9hbGV4L3NyYy9PcGVuR0wtMi40LjAuMS9HcmFwaGljcy9SZW5kZXJpbmcvT3BlbkdM
L0dML0NvbnRyb2xQb2ludC5ocwkyMDA5LTA5LTEzIDE3OjU0OjQ5LjAwMDAwMDAwMCArMDMwMAot
LS0gL3RtcC9idWZmZXItY29udGVudC0xMTM4MEtsMgkyMDExLTEwLTE4IDE0OjEyOjU1Ljg3Mzgy
Nzk0MSArMDMwMAoqKioqKioqKioqKioqKioKKioqIDE1NiwxNjIgKioqKgogICAgIE1hcDFUZXh0
dXJlQ29vcmQzIC0+IGdsX01BUDFfVEVYVFVSRV9DT09SRF8zCiAgICAgTWFwMVRleHR1cmVDb29y
ZDQgLT4gZ2xfTUFQMV9URVhUVVJFX0NPT1JEXzQKICAgICBNYXAxVmVydGV4MyAtPiBnbF9NQVAx
X1ZFUlRFWF8zCiEgICAgTWFwMVZlcnRleDQgLT4gZ2xfTUFQMV9WRVJURVhfMwogICAgIE1hcDJD
b2xvcjQgLT4gZ2xfTUFQMl9DT0xPUl80CiAgICAgTWFwMkluZGV4IC0+IGdsX01BUDJfSU5ERVgK
ICAgICBNYXAyTm9ybWFsIC0+IGdsX01BUDJfTk9STUFMCi0tLSAxNTYsMTYyIC0tLS0KICAgICBN
YXAxVGV4dHVyZUNvb3JkMyAtPiBnbF9NQVAxX1RFWFRVUkVfQ09PUkRfMwogICAgIE1hcDFUZXh0
dXJlQ29vcmQ0IC0+IGdsX01BUDFfVEVYVFVSRV9DT09SRF80CiAgICAgTWFwMVZlcnRleDMgLT4g
Z2xfTUFQMV9WRVJURVhfMwohICAgIE1hcDFWZXJ0ZXg0IC0+IGdsX01BUDFfVkVSVEVYXzQKICAg
ICBNYXAyQ29sb3I0IC0+IGdsX01BUDJfQ09MT1JfNAogICAgIE1hcDJJbmRleCAtPiBnbF9NQVAy
X0lOREVYCiAgICAgTWFwMk5vcm1hbCAtPiBnbF9NQVAyX05PUk1BTAoKRGlmZiBmaW5pc2hlZC4g
IFR1ZSBPY3QgMTggMTQ6MTI6NTYgMjAxMQo=
--0016368325ae861c7c04af90e873
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
HOpenGL mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/hopengl

--0016368325ae861c7c04af90e873--